This file contains 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
>> x = HelpFile.create(:title => "Test help file", :content => "Hello world!", :is_published => true, :publish_date => Time.now.utc) | |
=> #<HelpFile _id: test-help-file, title: Test help file, excerpt: Hello world!..., is_published: true, content: Hello world!, publish_date: 28/02/2010> | |
>> x.publish_date | |
ArgumentError: invalid date | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1573:in `new_by_frags' | |
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date.rb:1618:in `parse' | |
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/values/time_zone.rb:246:in `parse' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/extensions/time/conversions.rb:12:in `get' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/field.rb:35:in `get' | |
from /Library/Ruby/Gems/1.8/gems/mongoid-0.10.6/lib/mongoid/attributes.rb:32:in `read_attribute' |
This file contains 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 GalleryImagesController < ApplicationController | |
def rotate | |
@image = GalleryImage.find(params[:id]) | |
rotation = params[:deg].to_f | |
rotation ||= 90 # Optional, otherwise, check for nil! | |
@image.rotate!(rotation) | |
flash[:notice] = "The image has been rotated" | |
end |
This file contains 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
# Template created by You've Got Rails (http://www.youvegotrails.com) | |
# Remove unnecessary Rails files | |
run 'rm README' | |
run 'rm public/index.html' | |
run 'rm public/favicon.ico' | |
run 'rm public/images/rails.png' | |
# Remove Prototype files |
NewerOlder