Skip to content

Instantly share code, notes, and snippets.

@shu0115
Created December 22, 2014 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shu0115/bab859a3c60e34646471 to your computer and use it in GitHub Desktop.
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
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
# 良くない例
root_path('controller' => 'posts', 'action' => 'index')
# 良い例
root_path(controller: 'posts', action: 'index')
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
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