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
| /home/suerafa/.rvm/gems/ruby-1.9.2-p136@1_9_2_gemset/gems/json-1.5.1/lib/json/common.rb:66: [BUG] unknown type 0x22 (0xc given) | |
| ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux] | |
| -- control frame ---------- | |
| c:0053 p:---- s:0173 b:0173 l:000172 d:000172 CFUNC :initialize | |
| c:0052 p:---- s:0171 b:0171 l:000170 d:000170 CFUNC :new | |
| c:0051 p:0099 s:0168 b:0166 l:000165 d:000165 METHOD /home/suerafa/.rvm/gems/ruby-1.9.2-p136@1_9_2_gemset/gems/json-1.5.1/lib/json/common.rb:66 | |
| c:0050 p:0208 s:0157 b:0156 l:000155 d:000155 CLASS /home/suerafa/.rvm/gems/ruby-1.9.2-p136@1_9_2_gemset/gems/json-1.5.1/lib/json/ext.rb:24 | |
| c:0049 p:0011 s:0154 b:0154 l:000153 d:000153 CLASS /home/suerafa/.rvm/gems/ruby-1.9.2-p136@1_9_2_gemset/gems/json-1.5.1/lib/json/ext.rb:6 | |
| c:0048 p:0021 s:0152 b:0152 l:000151 d:000151 TOP /home/suerafa/.rvm/gems/ruby-1.9.2-p136@1_9_2_gemset/gems/json-1.5.1/lib/json/ext.rb:3 |
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
| def show | |
| @post = Post.find params[:id] | |
| 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
| def self.find_by_url(friendly_id) | |
| result = self.joins("JOIN slugs ON slugs.sluggable_id = posts.id and slugs.sluggable_type = 'Post'").where("slugs.name = ?", friendly_id).first | |
| raise ActiveRecord::RecordNotFound unless result | |
| result | |
| 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
| File.open( 'a.json', 'w') { |f| f.write Imovel.all.to_json(:include => {:videos => { :except => :updated_at }, :fotos => {:methods => :public_filename} }) } |
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
| group :development, :test do | |
| gem 'rspec-rails' | |
| gem 'shoulda' | |
| gem 'jasmine' | |
| gem "jasminerice" | |
| 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
| window.Album = Backbone.Model.extend({ | |
| url: function(){ | |
| return this.id ? '/collection/'+this.album_collection_id+'/album/'+this.id : '/collection/'+this.album_collection_id+'/albums'; | |
| }, | |
| defaults: { album: { | |
| album_collection_id: 0, | |
| title: "nothing", | |
| artist: "nobody", | |
| image: "", | |
| price: 0.0, |
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
| window.AlbumsCollection = Backbone.Collection.extend({ | |
| model: Album, | |
| initialize: function(collection_id){ | |
| this.url = '/collection/'+collection_id+"/albums"; | |
| } | |
| }); |
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
| var AlbumController = Backbone.Router.extend({ | |
| routes: { | |
| "collection/:album_collection_id/album/:id" : "show", | |
| }, | |
| initialize: function(options) { | |
| }, | |
| show: function(album_collection_id, id){ | |
| var albums = new SingleAlbumCollection(album_collection_id, id); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> | |
| <title>Home</title> | |
| </head> | |
| <body class="lift:content_id=main"> | |
| <div id="main" class="lift:surround?with=default;at=content"> | |
| <div> | |
| Hi, I'm a page that contains the time: |
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
| # Schema: User(name:string, password_digest:string, password_salt:string) | |
| class User < ActiveRecord::Base | |
| has_secure_password | |
| end | |
| user = User.new(:name => "david", :password => "", :password_confirmation => "nomatch") | |
| user.save # => false, password required | |
| user.password = "mUc3m00RsqyRe" | |
| user.save # => false, confirmation doesn't match | |
| user.password_confirmation = "mUc3m00RsqyRe" |
OlderNewer