Hi,
I am getting error, while executing below code.
please let me know the issue.
Add new phonenumber
<% form_tag '/create' do %>PersonName: <%= text_field 'phonenumber', 'personname' %>
PhoneNumber: <%= text_field 'phonenumber', 'phnumber' %>
TypeOfPhoneNumber: <%= collection_select(:phonenumber,:typeofnumber_id,@names,:id,:typeofnumber) %>
Description
<%= text_area 'phonenumber', 'description' %>
ERROR****
NoMethodError in Phonenumber#new
Showing app/views/phonenumber/new.rhtml where line #2 raised:
undefined method `^’ for “2”:String
Extracted source (around line #2):
1:
Add new phonenumber
2: <% form_tag ‘/create’ do %>
3:
PersonName:
4: <%= text_field ‘phonenumber’, ‘personname’ %>
5:
PhoneNumber:
RAILS_ROOT: C:/RubyForRails/railsapps/phonebook
Application Trace | Framework Trace | Full Trace
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in
block in secure_compare' C:/RubyForRails/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in
each’
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in
secure_compare' C:/RubyForRails/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in
verify’
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in
unmarshal' C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in
load_session’
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in
block in load!' C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in
stale_session_check!’
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in
load!' C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in
[]’
C:/RubyForRails/lib/ruby/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/request_forgery_protection.rb:102:in
form_authenticity_token' (eval):2:in
form_authenticity_token’
C:/RubyForRails/railsapps/phonebook/app/views/phonenumber/new.rhtml:2:in
`_run_rhtml_app47views47phonenumber47new46rhtml’
Request
Parameters:
None
Show session dump
Response
Headers:
{“Cache-Control”=>“no-cache”,
“Content-Type”=>""}
Regards,
GRR