I ended up overwriting the redirect method with this:
def redirect *a
r(302, '', 'Location' = 'my_vhost.net/my_app/' + R(*a).to_s)
end
Thoughts?
Dave
On Tue, May 19, 2009 at 11:05 AM, David Susco dsu...@gmail.com wrote:
Within an apache vhost I'm rewriting like this:
IfModule
I'm a little rusty on AR at the moment, but I think it looks something like
this:
In the controller:
if @user.valid?
# everything is fine
else
# ops! @user.errors contains the errors
end
//Magnus Holm
On Wed, May 20, 2009 at 19:43, David Susco dsu...@gmail.com wrote:
Can
Yeah, but in practice, you'd call @user.save, which internally calls
#valid?, and returns true or false on whether the object was saved or
not. If the object wasn't saved, @user.errors is populated with the
error messages.
-- Eric
On Wed, May 20, 2009 at 4:03 PM, Magnus Holm judo...@gmail.com
So, in my crud controllers, should I be using calls to save instead of
create and update_attributes? As those just return the object, and not
true of false based on my validations.
Dave
On Wed, May 20, 2009 at 4:30 PM, Eric Mill kproject...@gmail.com wrote:
Yeah, but in practice, you'd call
In my create actions, I customarily do like
@user = User.new params[:user
if @user.save
...
else
...
end
But update_attributes should also return true or false, I believe.
On Wed, May 20, 2009 at 4:42 PM, David Susco dsu...@gmail.com wrote:
So, in my crud controllers, should I be using
5 matches
Mail list logo