On 19 Apr 2011, at 07:52, Niklas Nson <[email protected]> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.