Carl Youngblood
2005-Oct-13 02:50 UTC
Undefined method `camelize'' for :controller:Symbol when calling render_component
Hello, I''m trying to reuse a form for editing users in more than one place using render_component. In the view of one action, http://app.com/security/editprofile, I''m calling: <% render_component :controller => :user, :action => :edit, :id => @user.id %> When I try to go to that action I get the following error: undefined method `camelize'' for :user:Symbol Here''s the trace: c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:50:in `component_class'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:46:in `component_response'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in `render_component_as_string'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in `component_logging'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in `render_component_as_string'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:28:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:28:in `render_component'' (erb):1:in `evaluate_locals'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:272:in `evaluate_locals'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:283:in `rhtml_render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in `render_template'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:173:in `render_file'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:588:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:591:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:604:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:627:in `render_with_no_layout'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:210:in `render_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in `render'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:757:in `perform_action_without_filters'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' script/server:49 I''m not really sure what''s happening. Any ideas? Thanks, Carl Youngblood
Carl Youngblood
2005-Oct-13 03:08 UTC
Re: Undefined method `camelize'' for :controller:Symbol when calling render_component
Apparently render_component doesn''t accept symbols for the component name--only strings. Changing my code to the following fixed the error: <% render_component :controller => ''user'', :action => :edit, :id => @user.id %> On 10/12/05, Carl Youngblood <carl.youngblood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''m trying to reuse a form for editing users in more than one place > using render_component. > > In the view of one action, http://app.com/security/editprofile, I''m calling: > > <% render_component :controller => :user, :action => :edit, :id => @user.id %>
Wilson Bilkovich
2005-Oct-13 03:13 UTC
Re: Undefined method `camelize'' for :controller:Symbol when calling render_component
This is a little weird, since it seems so different from the usual render() methods, but given the example in the API docs.. <% render_component :controller => "user", :action => "edit", :params => {"id" => @user.id} %> Does that work? The use of strings for keys inside the params hash seems strange to me.. I can''t think of another Rails method that requires that.. On 10/12/05, Carl Youngblood <carl.youngblood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''m trying to reuse a form for editing users in more than one place > using render_component. > > In the view of one action, http://app.com/security/editprofile, I''m calling: > > <% render_component :controller => :user, :action => :edit, :id => @user.id %> > > When I try to go to that action I get the following error: > > undefined method `camelize'' for :user:Symbol > > Here''s the trace: > > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:50:in > `component_class'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:46:in > `component_response'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in > `render_component_as_string'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in > `component_logging'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:41:in > `render_component_as_string'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:28:in > `send'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/components.rb:28:in > `render_component'' > (erb):1:in `evaluate_locals'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:272:in > `evaluate_locals'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:283:in > `rhtml_render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in > `send'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:208:in > `render_template'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_view/base.rb:173:in > `render_file'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:588:in > `render_with_no_layout'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in > `render_without_benchmark'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `measure'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:591:in > `render_with_no_layout'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in > `render_without_benchmark'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `measure'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:604:in > `render_with_no_layout'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:216:in > `render_without_benchmark'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `measure'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:627:in > `render_with_no_layout'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/layout.rb:210:in > `render_without_benchmark'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `measure'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:25:in > `render'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:757:in > `perform_action_without_filters'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in > `perform_action_without_benchmark'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `measure'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in > `perform_action'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > `send'' > c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > `process'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in > `handle_dispatch'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in > `service'' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' > c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in > `dispatch'' > script/server:49 > > I''m not really sure what''s happening. Any ideas? > > Thanks, > > Carl Youngblood > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >