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
| # rake routes: | |
| customer_zone_order_messages POST /zakaznicka_zona/orders/:order_id/messages(.:format) {:action=>"create", :controller=>"customer_zone/messages"} | |
| # routes.rb: | |
| scope(:path => 'my_path', :module => :customer_zone, :as => 'customer_zone') do | |
| resources :orders, :only => :show do | |
| resources :messages, :only => :create | |
| 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
| # First, you need to specify translated fields in your model | |
| # model.rb | |
| translates :text, :title | |
| # make translation migration (stolen from https://github.com/svenfuchs/globalize3) | |
| class CreatePosts < ActiveRecord::Migration | |
| def self.up | |
| Post.create_translation_table! :title => :string, :text => :text |
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
| Factory.define :application do |factory| | |
| factory.attachment(:sample, "public/samples/sample.doc", "application/msword") | |
| 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
| @jane = Factory(:user) | |
| @reward = Factory(:reward, :name => 'Invite friends', :points => 50, :every => 1.day) | |
| @jane.can_achieve?(:invite_friends).should be true | |
| @jane.achieve!(:invite_friends) | |
| @jane.points.should be 50 | |
| @jane.can_achieve?(:invite_friends).should be false | |
| @jane.time_to_unlock(:invite_friends).should be < 1.day |
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 | |
| # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
| require 'rubygems' | |
| require 'rails/commands/server' | |
| require 'rack' | |
| require 'webrick' | |
| require 'webrick/https' | |
| module Rails |
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
| Uncaught exception: RangeError: Maximum recursion depth exceeded | |
| Error thrown at line 16, column 21800 in <anonymous function: type>(a) in http://travis-ci.org/assets/application-84208c4b20a5b796c07724c8b7b89dc3.js: | |
| return a==?String(a):J[D.call(a)]||"object" | |
| called from line 16, column 21950 in <anonymous function: isPlainObject>(a) in http://travis-ci.org/assets/application-84208c4b20a5b796c07724c8b7b89dc3.js: | |
| if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)) | |
| called from line 16, column 19126 in <anonymous function: e.fn.extend>() in http://travis-ci.org/assets/application-84208c4b20a5b796c07724c8b7b89dc3.js: | |
| l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f) | |
| called from line 16, column 19126 in <anonymous function: e.fn.extend>() in http://travis-ci.org/assets/application-84208c4b20a5b796c07724c8b7b89dc3.js: | |
| l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e. |
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 install rails | |
| rails new retrorubies -m https://github.com/resolve/refinerycms/raw/master/templates/refinery/edge.rb |
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 install rails | |
| rails new retrorubies -m http://refinerycms.com/t/edge | |
| cd retrorubies | |
| rails s |
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
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.1' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3' |
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 'spec_helper' | |
| require 'rack/test' | |
| describe Api::Server do | |
| include Rack::Test::Methods | |
| def app | |
| ::Jimson::Server.new(::Api::Server.new) | |
| end |