Hi-
I am two weeks new to Ruby on Rails and I am working through the
SitePoint book. Specifically Chapter 7. I am trying to do the
permalink example for a story posting in their example, but I am
getting an undefined method error. I have checked all the textmate
files, and they match. And I have gone into the ruby console to pull
the story up, find the name, but when i write:
s.update_attribute :permalink, ‘my-shiny-weblog’. I get a the
following:
s.update_attribute :permalink, ‘my-shiny-weblog’
NoMethodError: undefined methodpermalink=' for #<Story:0x328d3c4> from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/ active_record/base.rb:1858:in
method_missing’
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/validations.rb:772:insend' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/ active_record/validations.rb:772:in
update_attribute’
from (irb):25
==========
When I run a full trace on
http://localhost:3000/story/show/my-shiny-weblog,
I get this:
NoMethodError in StoryController#show
undefined method `find_by_permalink’ for Story:Class
RAILS_ROOT: script/…/config/…
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/base.rb:1197:in method_missing' app/controllers/story_controller.rb:15:in
show’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:1095:in send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:1095:in
perform_action_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:632:in call_filter' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/filters.rb:619:in
perform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in
measure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/rescue.rb:83:in
perform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:430:in send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/base.rb:430:in
process_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/filters.rb:624:in
process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/ action_controller/session_management.rb:114:in
process’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/
action_controller/base.rb:330:in process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:41:in
dispatch’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
113:in handle_dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb: 79:in
service’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in
start’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:
63:in dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/ webrick.rb:59 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ active_support/dependencies.rb:495:in
require’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/
active_support/dependencies.rb:342:in new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ active_support/dependencies.rb:495:in
require’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:
39
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
script/server:3