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
| userJson = { | |
| student: {} | |
| } | |
| if discharge_date | |
| userJson["student"].merge(discharge_date: value) | |
| 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 BooksController < ApplicationController | |
| before_filter :authenticate_user! | |
| def index | |
| @books = current_user.books | |
| end | |
| def new | |
| @book = Book.new | |
| 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
| <% provide(:title, "Create course") %> | |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-4"> | |
| <div class="custom-form chapter"> | |
| <%= form_for(@course) do |f| %> | |
| <%= render 'shared/error_messages', object: f.object %> | |
| <%= f.label :title %> |
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 SuggestionController < ApplicationController | |
| def vote | |
| end | |
| def get | |
| 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
| response = RestClient.get 'http://localhost:3000/wallet_attributes', { :Authorization => "Token token=abc", :params => {:id => 50, 'foo' => 'bar'} } |
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
| <%= f.label :foo %> | |
| <%= f.text_area :foo %> |
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
| <%= f.fields_for :images do |image_field| %> | |
| <% if image_field.object.new_record? %> | |
| <%= render 'image_fields', :f => builder %> | |
| <% 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
| class ContentBlock < ActiveRecord::Base | |
| belongs_to :parent, polymorphic: true | |
| has_one :text_block, dependent: :destroy | |
| accepts_nested_attributes_for :text_block | |
| has_one :image_block, dependent: :destroy | |
| accepts_nested_attributes_for :image_block, reject_if: :attachment_not_updated |
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
| development: | |
| secret_token: token | |
| secret_key: key |
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
| ticket = Object.new | |
| def ticket.venue | |
| "Town Hall" | |
| end | |
| puts ticket.venue |