John Firebaugh
unread,Oct 13, 2009, 7:14:37 PM10/13/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to erector
Here's the relevant setup:
Rails::Initializer.run do |config|
config.gem "erector"
end
ActionController::Routing::Routes.draw do |map|
map.root :controller => "welcome"
end
class WelcomeController < ApplicationController
def index
end
end
class Views::Welcome::Index < Erector::RailsWidget
def content
link_to "Foo", '/bar'
end
end
Here's the error:
NoMethodError in Welcome#index
Showing app/views/welcome/index.rb where line #3 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.link_to
/opt/local/share/java/jruby/lib/ruby/gems/1.8/gems/erector-0.7.0/lib/
erector/rails/extensions/rails_widget/rails_helpers.rb:19:in `link_to'
rails_helpers.rb:19 (18 actually, off by one) is looking for a parent,
I guess? Isn't the desired behavior in this scenario for the parent to
be automatically set to the view?
Thanks,
John