-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionView::Template::Error (undefined method `model_name' for Symbol:Class): #1
Comments
To get a complete stack trace in rails please go to backtrace initializer and remove comment in front of line:Rails.backtrace_cleaner.remove_silencers! |
with a stack trace: Started GET "/categories?assoc_id=1&association=categories&eid=companies_1_categories&parent_model=company&adapter=list_inline_adapter" for 127.0.0.1 at 2010-12-27 07:27:05 -0800 ActionView::Template::Error (undefined method Rendered /home/mark/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (6.7ms) SQL (0.3ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name Category Load (5.6ms) SELECT "categories".* FROM "categories" ORDER BY position SQL (1.2ms) SELECT name SQL (0.3ms) SELECT name SQL (1.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.5ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name SQL (0.3ms) SELECT name Rendered /home/mark/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1744.5ms) |
perhaps a little easier on the eyes: http://pastie.org/1408729 |
hm. unfortunelty, stack trace does nt seem to be complete, cause latest entry should be the line pointing to the error. :-(, but it isnt. Next step would be to search your whole project for occurences of 'model_name' |
I see. You have this working in your app right? I don't think I am doing anything too unique. I am trying to use it in nested set. I got this working a long time ago, like 4 years ago with the original active scaffold sortable and added some mods for it to work with nested sets. Not sure what to expect as I have not seen this one work. Below is a grep for 'model_name' . Not sure if that is any help or not. mark@mark-solo:~/rails_apps/rails3/sushi_queue$ grep -r 'model_name' * log/development.log:ActionView::Template::Error (undefined method |
that grep w/ a pastie http://pastie.org/1408805 |
What happens if you open categories controller directly (not via companies nesting)? |
same thing: (pastie: http://pastie.org/1408885) actionpack (3.0.3) lib/action_view/render/partials.rb:363:in |
(here is the error from the page when I just load the categories). The stacktrace is above... NoMethodError in Categories#index Showing /home/mark/rails_apps/rails3/sushi_queue/vendor/plugins/active_scaffold_sortable/frontends/default/views/_list_with_header.html.erb where line #1 raised: undefined method `model_name' for Symbol:Class Extracted source (around line #1): 1: <%= render :super %> Trace of template inclusion: vendor/plugins/active_scaffold/frontends/default/views/list.html.erb |
Lemme know if you want to do a skype session or something. We could pair on this and solve it if you like. Not sure if you are having this problem at present or not. |
Did you find line of code, where crash is actually happening? |
Here is a full dump. I'd love to use this plugin but I get this error everytime I include it. I updated ruby to ruby-1.9.2-p136 [ x86_64 ] thinking that this could be a ruby problem however that proved fruitless. I am guessing you have this working. Not sure why I can't get it to work. Thanks, MarkStarted GET "/admin/categories?assoc_id=2&association=categories&eid=admin__companies_2_categories&parent_scaffold=admin%2Fcompanies&adapter=list_inline_adapter" for 127.0.0.1 at Tue Jan 18 10:08:29 -0800 2011 ActionView::Template::Error (undefined method Rendered /home/mark/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.8ms) SQL (0.3ms) SELECT name SQL (0.6ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.5ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.5ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.6ms) SELECT name SQL (0.4ms) SELECT name SQL (0.3ms) SELECT name SQL (0.5ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name SQL (0.6ms) SELECT name SQL (0.5ms) SELECT name SQL (0.4ms) SELECT name SQL (0.4ms) SELECT name |
Because you are using haml can you please take a look at: If that does nt help. |
Thanks vhochstein. I got this to work. Thanks so much for the speedy reply. Mark |
Well, round about a month to solve this issue ... I would nt call that speedy, but I am really glad that we finally found a solution. |
Can you detail the solution that you found to this problem? The link to the closed issue above is not working, and I'm experiencing the same problem |
github changed their issue links: |
Hi,
I am not really sure how to get a stack trace from active_scaffold but here is the logs from an error I am getting while using this plugin.
My controller looks like this:
active_scaffold :category do |conf|
conf.actions << :sortable
conf.sortable.column = :position
conf.columns = [:name, :description, :image, :items]
end
my model looks like such:
class Category < ActiveRecord::Base
attr_accessible :name, :image, :description, :ayce, :take_out
has_many :items, :dependent => :destroy
belongs_to :company
acts_as_list :scope => :company
default_scope :order => 'position'
end
If I turn off the conf.actions << :sortable and the conf.sortable.column = :position everything works again.
Thanks for the putting this together. Let me know if there is anything I can do to provide you with more detail, eg stack traces.
Happy New Year!
Mark McDonald
Here is the logs.
Started GET "/categories?assoc_id=1&association=categories&eid=companies_1_categories&parent_model=company&adapter=_list_inline_adapter" for 127.0.0.1 at 2010-12-27 06:50:37 -0800
Processing by CategoriesController#index as /
Parameters: {"assoc_id"=>"1", "association"=>"categories", "eid"=>"companies_1_categories", "parent_model"=>"company", "adapter"=>"_list_inline_adapter"}
Geokit is using the domain: localhost
SQL (0.5ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
User Load (4.8ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
Role Load (0.3ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE ("roles_users".user_id = 1 ) AND ("roles"."name" = 'Admin') LIMIT 1
Company Load (0.5ms) SELECT "companies".* FROM "companies" WHERE ("companies"."id" = 1) LIMIT 1
CACHE (0.0ms) SELECT "companies".* FROM "companies" WHERE ("companies"."id" = 1) LIMIT 1
SQL (0.4ms) SELECT COUNT() FROM "categories" WHERE ("categories".company_id = 1)
Category Load (4.2ms) SELECT "categories". FROM "categories" WHERE ("categories".company_id = 1) ORDER BY position, "categories"."position" ASC
Item Load (8.8ms) SELECT "items".* FROM "items" WHERE ("items".category_id IN (1,2,3,4,5))
Rendered vendor/plugins/active_scaffold_sortable/frontends/default/views/_list_with_header.html.erb (2.4ms)
Rendered vendor/plugins/active_scaffold/frontends/default/views/list.html.erb (20.8ms)
Completed in 403ms
ActionView::Template::Error (undefined method `model_name' for Symbol:Class):
1: <%= render :super %>
2: <% if ActiveScaffold.js_framework == :prototype %>
3: <%= sortable_element *sort_params %>
4: <% elsif ActiveScaffold.js_framework == :jquery %>
Rendered /home/mark/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.2ms)
SQL (1.0ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.5ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.5ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.6ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
Category Load (5.3ms) SELECT "categories".* FROM "categories" ORDER BY position
SQL (0.4ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.4ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.4ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.4ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.4ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
Rendered /home/mark/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1464.6ms)
Rendered /home/mark/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (1486.7ms)
The text was updated successfully, but these errors were encountered: