Frage

I need such a construction:

form_for Project.new

where Project is a model, that's not inherited from AR/AM/Mongoid (inherited from Spira).

Is there some monkey-patch to make Spira models answer to url_for Project.new with correct 'http://example.org/projects'?

Now it gives an exception

No route matches {:controller=>"projects", :id=>, :action=>"show"}

http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-url_for

here it's said, url_for uses persisted?, but I defined persisted? correctly in instance methods and that doesn't work.

Any ideas?

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top