Created
December 22, 2014 08:23
-
-
Save shu0115/bab859a3c60e34646471 to your computer and use it in GitHub Desktop.
Ruby on Rails 4.2 個人的な気になるポイント ref: http://qiita.com/shu_0115/items/c04ebcf9b4d4fa8b76ea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/posts', to: MyRackApp => (変更不要) | |
get '/posts', to: 'post#index' => (変更不要) | |
get '/posts', to: 'posts' => get '/posts', controller: :posts | |
get '/posts', to: :index => get '/posts', action: :index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 良くない例 | |
root_path('controller' => 'posts', 'action' => 'index') | |
# 良い例 | |
root_path(controller: 'posts', action: 'index') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_filter => after_action | |
append_after_filter => append_after_action | |
append_around_filter => append_around_action | |
append_before_filter => append_before_action | |
around_filter => around_action | |
before_filter => before_action | |
prepend_after_filter => prepend_after_action | |
prepend_around_filter => prepend_around_action | |
prepend_before_filter => prepend_before_action | |
skip_after_filter => skip_after_action | |
skip_around_filter => skip_around_action | |
skip_before_filter => skip_before_action | |
skip_filter => skip_action_callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pp topic | |
#<Topic:0x007fb93696bcb0 | |
id: 1, | |
title: "The First Topic", | |
author_name: "David", | |
author_email_address: "david@loudthinking.com", | |
written_on: 2003-07-16 14:28:11 UTC, | |
bonus_time: 2000-01-01 14:28:00 UTC, | |
last_read: Thu, 15 Apr 2004, | |
content: "Have a nice day", | |
important: nil, | |
approved: false, | |
replies_count: 1, | |
unique_replies_count: 0, | |
parent_id: nil, | |
parent_title: nil, | |
type: nil, | |
group: nil, | |
created_at: 2014-05-18 21:31:53 UTC, | |
updated_at: 2014-05-18 21:31:53 UTC> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment