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
| #!/usr/bin/env ruby | |
| class Parent | |
| private | |
| def name | |
| 'Mommy' | |
| end | |
| end | |
| class Child < Parent |
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
| <%= error_messages_for :user %> |
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_for @user do |f| %> | |
| <%= f.text_field :name %> | |
| <%= f.error_message_on :name %> | |
| <% 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 User < ActiveRecord:Base | |
| validate :user_is_happy_and_broke | |
| private | |
| def user_is_happy_and_broke | |
| if self.state_of_mind != 'happy' || self.fiscal_status != 'broke' | |
| errors.add :user_not_happy_and_broke, 'User must be happy and broke to continue' | |
| end | |
| 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_for @user do |f| %> | |
| <%= f.error_message_on :user_not_happy_and_broke %> | |
| <% 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 JobsController < ApplicationController | |
| before_filter :require_user | |
| ssl_required :index, :new, :create, :update, :destroy, :destroy_all | |
| respond_to :html, :only => [:index, :new, :create, :destroy, :destroy_all] | |
| respond_to :json, :only => [:index, :create, :update, :destroy] | |
| [... omitted ...] |
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
| gem 'mini_magick' | |
| gem 'carrierwave' |
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
| rails g uploader Photo |
OlderNewer