- add web server gem to your Gemfile
1 2 3 4 5 |
|
- bundle it for updating your Gemfile.lock
1 2 3 |
|
- deploy to heroku
1
|
|
done.
- time zone config for heroku
1
|
|
done.
- for reset pg DB
1
|
|
1 2 3 4 5 |
|
1 2 3 |
|
1
|
|
1
|
|
1
|
|
1
|
|
1 2 3 4 |
|
1 2 3 |
|
1 2 |
|
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 |
|
1
|
|
1 2 3 4 5 6 7 8 |
|
1
|
|
1 2 |
|
1 2 |
|
Rails scaffold generators are very smart! you can use belongs_to to quickly add relations. In the following example, I have 2 models products and product_types; Product_types belong to product and product has many product types.
1 2 3 4 5 6 7 8 9 |
|
This will generate the necessary columns, indexes and associations in your models.
1 2 3 4 |
|
1 2 3 4 5 6 7 8 |
|
http://filterrific.clearcove.ca
http://www.lauradhamilton.com/how-to-filter-by-multiple-options-filterrific-rails
https://github.com/plataformatec/has_scope
http://apidock.com/rails/v3.2.13/ActionView/Helpers/UrlHelper/url_for
http://stackoverflow.com/questions/6625293/how-to-add-parameters-to-current-url-in-rails
http://www.justinweiss.com/blog/2014/02/17/search-and-filter-rails-models-without-bloating-your-controller/
http://guides.rubyonrails.org/active_record_querying.html#scopes
Brakeman is an open source vulnerability scanner specifically designed for Ruby on Rails applications. It statically analyzes Rails application code to find security issues at any stage of development.
rails_best_practices is a code metric tool to check the quality of rails codes.
1 2 3 4 5 6 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
http://brakemanscanner.org
http://rails101s.logdown.com/posts/247140-20-1-0-create-a-rails-project
https://github.com/railsbp/rails_best_practices
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
To figureout what differece between before_action and before_filter, we should understand what difference between action and filter.
An action is a method of a controller to which you can route to.
For example, your user creation page might be routed to UsersController#new - new is the action in this route.
Filters run in respect to controller actions - before, after or around them.
These methods can halt the action processing by redirecting or set up common data to every action in the controller.
Rails 4 –> _action
Rails 3 –> _filter