Skip to content
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

write a generator to make a model orderable by creating a position field and adding the act_as_orderable macro #12

Closed
3 tasks done
vala opened this issue Oct 12, 2014 · 1 comment

Comments

@vala
Copy link
Contributor

vala commented Oct 12, 2014

  • Create a migration to add t.integer :position, default: 0 field
  • Add acts_as_orderable to the target model
  • Add the needed route (see below)
# config/routes.rb
component :component do
  resources :resources do 
    collection do
      patch 'order'
    end 
  end
end
@vala
Copy link
Contributor Author

vala commented Nov 25, 2014

The generator does not add the route, it informs you that you should add it yourself, generating it could be a bit dangerous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant