I have a named scope ‘profile’ that points to ‘users/edit’ (there is no
id
as I’m using Authlogic). When the update fails, I want to keep the same
url
/profile and keep my error messages. How do I do this? Using render
:action
=> ‘edit’ or ‘profile’ (I set up a profile template to test it) Redirect
allows me to keep the url but I lose the error messages.
I have a named scope ‘profile’ that points to ‘users/edit’ (there is no
id
as I’m using Authlogic).
Did you mean a named route? This doesn’t make sense with a named
scope.
When the update fails, I want to keep the same
url
/profile and keep my error messages. How do I do this? Using render
:action
=> ‘edit’ or ‘profile’ (I set up a profile template to test it) Redirect
allows me to keep the url but I lose the error messages.
On 3 November 2010 18:38, Marnen Laibow-Koser [email protected]
wrote:
Best,
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
Yes, I have tried it as I said. It was one of the first things I did try.
As I said, it acts like render :action and this is from the docs …
Template rendering works just like action rendering except that it takes
a
path relative to the template root. The current layout is automatically
applied.
You have a named route for the edit-action, but don’t use one for the
update-action, right?
I think there is the answer to find. Make a new post-only named route
for your update action.
Or don’t use another route but define your resources with :as =>
“profile”
On 3 November 2010 18:38, Marnen Laibow-Koser [email protected]
wrote:
Best,
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
Yes, I have tried it as I said. It was one of the first things I did try.
As I said, it acts like render :action and this is from the docs …
Template rendering works just like action rendering except that it takes
a
path relative to the template root. The current layout is automatically
applied.
Hmm. My recollection is that render :action or render :template should
not change the URL of the already selected controller action, so you
should still see the profile URL. I’m not sure why this wouldn’t work,
unless you’ve got some JavaScript doing funny things, or unless I’m
misremembering.