I am really really stuck and annoyed with this right now.
I am running Rails 2.3.5
My View/pages/customers.html.erb
simply has:
<% form_tag do %>
First Name
<%= text_field_tag :firstName, params[:firstName] %>
Last Name
<%= text_field_tag :lastName, params[:lastName] %>
<%= submit_tag "Enter" %>
<%end%>
My Models/customer.rb
simply has:
class Customer < ActiveRecord::Base
attr_accessible :firstName, :lastName
end
My Controller/pages_controller
has
class PagesController < ApplicationController
def custs
@cust = Customer.new(params[:firstName], params[:lastName])
@cust.save
end
end
so as you see I am just trying to enter two fields from front end and then save them to the DB. However, whenever i load my page it give me error:
wrong number of arguments (2 for 1) pages_controller.rb:3:in
new' pages_controller.rb:3:in
custs'
weird thing is that when I use the sandbox script/console I am able to insert data fine.
What is going on here? please someone explain!