On 19 Apr 2011, at 07:52, Niklas Nson
<niklasnson-5ZBJkHaGu7EwFerOooGFRg@public.gmane.org> wrote:
> Have the following form:
>
> <%= simple_form_for @user, :as => :user, :action =>
> "edit_notification" do |f| -%>
> <%= f.input :email %>
> <%= f.input :email_alerts %>
> <%= f.input :email_summarize %>
> <%= f.input :email_newsletter %>
> <%= f.input :email_announcements %>
> <%= f.button :submit %>
> <% end %>
>
> It should trigger the edit_notification action ? But it triggers the
> standard edit action. Do i have to add more routes then:
> resources :users to get it to trigger ?
>
To override the default URL that a form posts to, you need to say something
along the lines of :url => {:action => ''blah'', :id =>
@user.id}
You don''t have to create a route for it, but it''s generally
neater to do so
Fred> This is driving me mad at the time.
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.