Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4111972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:08:05+00:00 2026-05-20T22:08:05+00:00

I have a form in my Profile edit view beginning with this line: <%

  • 0

I have a form in my Profile edit view beginning with this line:

<% form_for @profile, :html => { :multipart => true } do |f| %>

Profile undergoes Single Table Inheritance and the two subclasses are Profile::Artist and Profile::Listener.

When I try to access the edit view for the 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 lines 1 is the line of code for the form that 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 the submit button to <%= f.submit :profile %>

Now I just get a routes error…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:08:06+00:00Added an answer on May 20, 2026 at 10:08 pm

    Not Vehile but Profile!

    def self.inherited(child)
      child.instance_eval do
        def model_name
          Profile.model_name
        end
      end
      super
    end
    

    or

    def self.model_name
      name = "profile"
      name.instance_eval do
        def plural;   pluralize;   end
        def singular; singularize; end
        def i18n_key; singularize; end
        def human(*args); singularize; end
      end
      return name
    end
    

    UPDATE

    An actual problem was in form. You should add :method => :put

    <%= form_for(@profile, :html => { :multipart => true, :method => :put }) do |f| %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form area in my view. If I click button A , I
I have a form like this: <form name=mine> <input type=text name=one> <input type=text name=two>
In my user's data edit form I have a boolean field, for adding/removing email
I have designed a user profile form, a long form which is quite complicated.
I have a simple html input textbox in a very simple form. the information
When I have the following action in a form tag, what does the '/Account/Profile`
I have a SQL Table with the following columns: PROFILE ---------------------------------- Name | DateOfBirth
I have form that displays several keywords (standard set of choice lists that changes
I have a form in C# that has a button that, when clicked, I
I have subclassed Form to include some extra functionality, which boils down to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.