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 7516149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:02:39+00:00 2026-05-30T01:02:39+00:00

here’s my controller: class TalentController < ApplicationController def index end def new @talent =

  • 0

here’s my controller:

class TalentController < ApplicationController
  def index
  end

  def new
    @talent = Talent.new
  end

  def create
        @talent.update_attributes!(params)
  end
end

here’s my app/views/talent/new.html.haml:

= "Create new talent"

= form_for @talent, :url => {:action=>:create, :controller=>"talent"}, :method => :post do |f|
  = f.label :First_Name
  = f.text_field :first_name
  = f.label :Last_Name
  = f.text_field :last_name
  = f.label :City
  = f.text_field :city
  = f.label :State
  = f.text_field :state
  = f.label :Zip_code
  = f.text_field :zip_code
  = f.submit "Create"

When I hit the create button, I get this error.

No route matches [POST] "/talent/new"

here’s my rake routes:

                    /                          {:action=>"index", :controller=>"talent"}
talent_index GET    /talent(.:format)          {:action=>"index", :controller=>"talent"}
             POST   /talent(.:format)          {:action=>"create", :controller=>"talent"}
  new_talent GET    /talent/new(.:format)      {:action=>"new", :controller=>"talent"}
 edit_talent GET    /talent/:id/edit(.:format) {:action=>"edit", :controller=>"talent"}
      talent GET    /talent/:id(.:format)      {:action=>"show", :controller=>"talent"}
             PUT    /talent/:id(.:format)      {:action=>"update", :controller=>"talent"}
             DELETE /talent/:id(.:format)      {:action=>"destroy", :controller=>"talent"}

What did I miss here??

  • 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-30T01:02:41+00:00Added an answer on May 30, 2026 at 1:02 am

    I don’t know why the form is trying to post to new. However, there are some improvements to be made to your code. First of all it is not necessary to pass :url and :method to form_for. The only thing you need is:

    = form_for @talent do |f|
    

    Rails takes care of the rest automatically.

    The code in the create method of your controller is incorrect. When create is called it is a new request and therefore @talent will be undefined. You have to set it first. The second mistake is that you are using update_attributes, which is used to update an existing record in the database. You want to create a new record, so you have to use create. Another way would be to simply create a new instance of Talent and call save on it.

    So, it should look like this:

    def create
      @talent = Talent.create(params[:talent])
    end
    

    Or like this:

    def create
      @talent = Talent.new(params[:talent])
      if @talent.save
        # Saved successfully, do a redirect or something...
      else
        # Validation failed. Show form again so the user can fix his input.
        render :action => 'new'
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my problem : I have a post controller with the action create.
Here is the scenario: I'm writing an app that will watch for any changes
Here's my procedure: DROP PROCEDURE IF EXISTS `couponExpires`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `couponExpires`(IN couponID BIGINT,
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here is my situation: I have a controller action called OrderFromCategory which fills a
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.