Hi,
I've been struggling with using form_for.
I have a very simple app, with one resource defined in the router.
Merb::Router.prepare do
resources :users
end
My resource has been created with `merb-gen resource User`, and I
haven't changed any of the controller-level code, so in my new action
I have an @user, which is an unsaved ActiveRecord object. Reading the
docs, it seems I should be able to do:
<%= form_for(@user) do %>
... my fields ..
<% end =%>
in my view. But this produces the wrong url: "/user" rather than the
required "/users". Now if I go and remove the `default_routes` from
the router, it blows up when trying to show the page with a Generation
Error - "Named route not found: default". If I instead use
form_for(:user), I still get the Generation error, but this time the
message is: "Named route user could not be generated with {:id=>nil}".
Should I be doing something different, or is this a bug I should raise
in lighthouse?
Cheers,
Roland
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---