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
| <div class="row"> | |
| <div class="col-md-2 col-sm-2 col-xs-2"> | |
| <p><button class="btn btn-primary btn-sm" id="get-weather-btn"><span>Get Weather</span></button></p> | |
| </div><!-- .col --> | |
| <div class="col-md-10 col-sm-10 col-xs-10"> | |
| <div class="panel panel-default"> | |
| <div class="panel-heading">Weather & Location Response</div> | |
| <div class="panel-body"> | |
| <p>Enter Address: <input id="address" type="text" class="form-control"/></p> | |
| <p>Lat/Long: <input id="location-lat-long" type="text" class="form-control"/></p> |
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 PurchasePower | |
| def self.base | |
| 500 | |
| end | |
| def process_request(request) | |
| raise NotImplementedError | |
| end | |
| private |
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
| a = [] | |
| 1.upto(9) do |t| | |
| a.push(t) | |
| end | |
| a = a.permutation.to_a.reverse | |
| nums =[] | |
| for i in 0..a.length | |
| num = a[i].map(&:to_s).join.to_i | |
| 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 ApplicationController < ActionController::Base | |
| protect_from_forgery with: :exception | |
| include Pundit | |
| after_action :verify_authorized, unless: :unverified_controller? | |
| def unverified_controller? |
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 Currency < ActiveRecord::Base | |
| has _many :countries | |
| validates :countries, :presence => true | |
| end | |
| class Country < ActiveRecord::Base | |
| belongs_to :currency | |
| validates :currency, :presence => true | |
| end |