Sample

ashraf_zmn Apr 16, 2014 3 thanks

Here is a sample usage of its,

==== Code example

describe '#rate_for_date' do
context 'with date with in the range' do
  subject do 
    FactoryGirl.build(:allocated_room_rate, 
        start_date: Time.zone.now, 
        end_date: 2.day.from_now, 
        price: 100...

Grammatical error

rajivekjain Apr 1, 2014

Hi - not sure where I would submit this so just putting here. My apologies if not in the right place.

default: “, and ” - this is grammatically wrong. There should be no comma with the last and.

Example:

['one', 'two', 'three'].to_sentence

should give: "one, two and three"

There is no ' .......

Rendering JSONP

KiChjang Feb 19, 2014

If you provide the :callback option with a nil value, then the default JSON object will be returned. As such, this makes creating JSONP response from the render syntax very easy in your controllers, like so:

render json: @object, callback: params[:jsoncallback]

Undocumented pile of ruby

cek Feb 19, 2014

If you’d like to read someone’s RSS feed with your Ruby code, you’ve come to the right place


No, you've definitely come to wrong place. RSS is one of the worst documented libraries I've ever seen for Ruby. It's as confusing and misleading as it can get.

re: question?

hoff2 Jan 22, 2014

Nope. Read it again:

This generates a sequence of self.size n-element arrays

If any of the arguments are longer than the receiver, the elements beyond the receiver's length are ignored

Storing array values

jebin Jan 16, 2014 1 thank

I tried to add a array value using hidden_field_tag and access it in jquery. It just returns the flattened version of array. eg:(If i try to store [1,[1,2,3]] in hidden_field_tag , in jquery iam just getting '1 1 2 3') but if i use input field with type=hidden iam getting the correct value. Why is...