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'm trying to override FOSUserBundle form Edit profile ; I have created the class
I have a Ruby on Rails page to edit a users profile. The form
I have form in my page, I am using ajax.beginform(). Inside this form I
I have form like this: <div class=satu> <input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'> </div>
I have form like this : <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a
In my user's data edit form I have a boolean field, for adding/removing email
I have a form that allows a user to update their profile information, but
I have this form which is displayed none on page load. And upon clicking
I have a problem. I have form inside a fancybox. This form have a
I have a form, with a partial view inside it to render several child

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.