I have a form in my profile edit view starting from this line:
<% form_for @profile, :html => { :multipart => true } do |f| %>
A profile is subjected to single inheritance on a page, and two subclasses are the profile :: Artist and Profile :: Listener.
When I try to access the edit view for a profile, I get this error:
NoMethodError in Profiles#edit Showing /rubyprograms/dreamstill/app/views/profiles/edit.html.erb where line #1 raised: undefined method `profile_artist_path' for #<#<Class:0x103359a18>:0x1033560c0>
where line 1 is the line of code for the form I posted above. How can I fix this error?
UPDATE:
I added this code to my profile model:
def self.inherited(child) child.instance_eval do def model_name Vehicle.model_name end end super end
And now my error has changed to:
NameError in Profiles#edit Showing /rubyprograms/dreamstill/app/views/profiles/edit.html.erb where line #1 raised: uninitialized constant Profile::Vehicle
UPDATE 2:
I changed the first line of the form to:
<% form_for(:profile, @profile, :url => {:controller => "profiles", :action => "update"}, :html => { :multipart => true }) do |f| %>
and submit button on <%= f.submit :profile %>
Now I just get the routes error ...