Upgrade to Pro — share decks privately, control downloads, hide ads and more …

おすすめ gem

おすすめ gem

Slideshare (http://www.slideshare.net/chocoby/gem-13022540) にアップロードしていたものですが、Speaker Deck にアップロードしてみました。
社内の LT で発表したものです。

Kenta Okamoto

July 02, 2012
Tweet

More Decks by Kenta Okamoto

Other Decks in Programming

Transcript

  1. *** REMOTE GEMS *** activerecord-jdbcmysql-adapter (1.2.2, 1.0.3 java) activerecord-mysql-adapter-flags (0.0.3)

    activerecord-mysql2-retry-ext (0.1.0) activerecord-mysql2legacydb-adapter (0.2.0) activerecord-mysql2spatial-adapter (0.4.2) activerecord-mysqlspatial-adapter (0.4.1) airblade-mysql_s3_backup (0.0.4) aqueduct-mysql (0.1.0) capistrano-mysqldump (1.06) create_rails_mysql_db (0.2.3) ...
  2. *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.2.1) actionpack (3.2.1)

    activemodel (3.2.1) activerecord (3.2.1) activeresource (3.2.1) activesupport (3.2.1) addressable (2.2.8) arel (3.0.0) awesome_print (1.0.2) ...
  3. # app/models/ability.rb class Ability include CanCan::Ability def initialize(user) user ||=

    User.new can :destroy, Post, user_id: user.id end end # app/controllers/posts_controller.rb class PostsController < ApplicationController before_filter :authenticate_user! load_and_authorize_resource # app/views/posts/edit.erb <% if can? :destroy, @user %> <%= link_to '࡟আ', posts, method: :delete %> <% end %>