Giter Site home page Giter Site logo

vhochstein / active_scaffold_sortable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from activescaffold/active_scaffold_sortable

6.0 6.0 2.0 210 KB

Rails 3 drag-drop sortable lists for ActiveScaffold supporting jquery and prototype

Home Page: http://tim.theenchanter.com/2008/05/activescaffoldsortable-updated-with.html

License: MIT License

Ruby 99.50% CSS 0.50%

active_scaffold_sortable's People

Contributors

robd avatar timcharper avatar vhochstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

itkin nakedmoon

active_scaffold_sortable's Issues

ActionView::Template::Error (undefined method `model_name' for Symbol:Class):

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)

namespace create invalid url after drop row

I have ve a rails application with different namespaces: admin and members.
When using the sortable feature in a controller /admin/sortable_controller after drop the table row in a new position the request for updating record position was called on /admin/admin/sortable_controller/reorder instead of /admin/sortable_controller/reorder.
I'm using jquery and the vho rails-3.0 branch of AS with rails 3.0.9

I fixed the problem sending to ActiveScaffold.sortable js method a controller path with a trail slash (send /admin/sortable_controller instead of admin/sortable_controller). I replaced controller_path.to_json with url_for(:controller => controller_name).to_json at row 5 of the _list_with_header.html.erb

NameError when added active_scaffold_sortable_vho to Gemfile

I've just added active_scaffold_sortable_vho to my Gemfile and receive the following:

NameError: uninitialized constant ActionDispatch::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING

No other configuration has been made. Is this a known error?

Cheers

Johan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.