FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| # SSL self signed localhost for rails start to finish, no red warnings. | |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
| html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe | |
| # add nokogiri gem to Gemfile | |
| form_fields = [ | |
| 'textarea', | |
| 'input', | |
| 'select' | |
| ] |
| sudo apt-get install unzip; | |
| wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/; |
| #app/controllers/application_controller.rb | |
| class ApplicationController < ActionController::Base | |
| def opensearch | |
| response.headers['Content-Type'] = 'application/opensearchdescription+xml; charset=utf-8' | |
| end |
| # == Schema Information | |
| # | |
| # Table name: showings | |
| # | |
| # id :integer not null, primary key | |
| # start_time :datetime | |
| # end_time :datetime | |
| class Showing < ActiveRecord::Base | |
| attr_accessor :showing_date, :start_date, :end_date |
| # This file goes in config/initializers | |
| require 'bootstrap_form_builder' | |
| # Make this the default Form Builder. You can delete this if you don't want form_for to use | |
| # the bootstrap form builder by default | |
| ActionView::Base.default_form_builder = BootstrapFormBuilder::FormBuilder | |
| # Add in our FormHelper methods, so you can use bootstrap_form_for. | |
| ActionView::Base.send :include, BootstrapFormBuilder::FormHelper |
| // Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core? | |
| L.TileLayer.Common = L.TileLayer.extend({ | |
| initialize: function (options) { | |
| L.TileLayer.prototype.initialize.call(this, this.url, options); | |
| } | |
| }); | |
| (function () { | |
| // Based on http://snipt.net/boriscy/datetime-jquery-formtastic/ | |
| $.tools.dateinput.localize("ja", { | |
| months: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
| shortMonths: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
| days: '日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日', | |
| shortDays: '日,月,火,水,木,金,土' | |
| }); | |
| $.tools.dateinput.conf.format = 'yyyy-mm-dd'; |
| // JS Module Pattern: | |
| // http://j.mp/module-pattern | |
| // Redefine: $, window, document, undefined. | |
| var APP = (function($, window, document, undefined) { | |
| // Automatically calls all functions in APP.init | |
| $(document).ready(function() { | |
| APP.go(); | |
| }); |