okkezSS
1
Help me please, very urgent.
I have resources that lay in plugin, they have structure like
Somename::Arch::Notes
Also I have controllers for this model in different controller, that lay
in
sysadmin/notes
When the form is building with form_for it tries to generate path with
method
somename_arch_notes_path
But it is not generated by routes.rb
I have there:
map.resources :notes, :controller => ‘/sysadmin/notes’, :path_prefix =>
‘/somename/arch’
In ‘rake routes’ I have only notes_path but not somename_arch_notes_path
Is it possible to add that prefix somename_arch_ to methods that are
generated
Thanks!
Ok, I found solution it is :name_prefix
But I now have errors like
edit_somename_arch_note_url failed to generate from
{:controller=>“sysadmin/notes”, :action=>“edit”,
:id=>#<Somename::Arch::Note id: 2, body: “ddd”, subject: “fsd”, user_id:
10022, object_id: 6, object_type: “Somename::Arch::Fruit”, created_at:
“2010-10-29 11:18:09”, updated_at: “2010-10-29 11:18:09”>}, expected:
{:controller=>"/sysadmin/notes", :action=>“edit”}, diff:
{:controller=>"/sysadmin/notes", :id=>#<Smtpcom::Arch::Note id: 2, body:
“ddd”, subject: “fsd”, user_id: 10022, object_id: 6, object_type:
“Somename::Arch::Fruit”, created_at: “2010-10-29 11:18:09”, updated_at:
“2010-10-29 11:18:09”>}