This file contains hidden or 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
| %table#myTable | |
| %thead | |
| %tr | |
| %th | |
| %span.arrow | |
| / <=ここにアイコンを挿入する。 | |
| %th | |
| %span.arrow | |
| / <=ここにアイコンを挿入する。 | |
| %th{ span: "2" } |
This file contains hidden or 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
| class AddRoomToMovings < ActiveRecord::Migration | |
| def change | |
| add_reference :movings, :room, index: true, foreign_key: true | |
| end | |
| end |
This file contains hidden or 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
| .form-inline | |
| .checkbox | |
| %label | |
| = f.check_box :rooms, options, checked_value, unchecked_value | |
| = room_name |
This file contains hidden or 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
| group :test do | |
| gem 'rspec-rails' | |
| gem 'capybara' | |
| gem "poltergeist" | |
| end |
This file contains hidden or 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
| class OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
| def facebook | |
| user = User.from_omniauth(request.env["omniauth.auth"]) | |
| if user.persisted? | |
| set_flash_message(:notice, :success, kind: "Facebook") if is_navigational_format? | |
| sign_in_and_redirect user, event: :authentication | |
| else | |
| session["devise.user_attributes"] = user.attributes | |
| redirect_to new_user_registration_url |
This file contains hidden or 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
| #... | |
| # ==> OmniAuth | |
| TWITTER_API_KEY = "T0ONiGrNuMNsKb5AyNC05mOpe" | |
| TWITTER_API_SECRET = "FxrQ6ddvlVbIaUlvEm0xg4fgoK9ACmWWnkesdU60ck1vJFoBM8" | |
| #... |
This file contains hidden or 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
| # Override | |
| class ConfirmationsController < Devise::ConfirmationsController | |
| def show | |
| self.resource = resource_class.confirm_by_token(params[:confirmation_token]) | |
| yield resource if block_given? | |
| if resource.errors.empty? | |
| set_flash_message(:notice, :confirmed) if is_flashing_format? | |
| sign_in(resource) # この一行を加えるのみ |
This file contains hidden or 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
| require File.expand_path('../boot', __FILE__) | |
| require 'csv' | |
| require 'rails/all' | |
| # ... |
This file contains hidden or 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
| Devise.setup do |config| | |
| #... | |
| config.reconfirmable = true | |
| #... |