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
| # If we save a record using ember-data's RESTadapter, and it fails, Rails | |
| # returns the validation errors of the model as JSON hash: | |
| # | |
| # {"errors":{"name":["may not be blank"]}} | |
| # | |
| # This patches the RESTadapter to add these errors to the invalid record. It | |
| # can be removed when the following Pull Request was merged into ember-data: | |
| # https://github.com/emberjs/data/pull/376 | |
| DS.RESTAdapter.reopen |
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
| // <== BOOTSTRAP | |
| var App = Ember.Application.create(); | |
| App.stateManager = Ember.StateManager.create(); | |
| DS.fixtureAdapter.createRecord = function(store, type, record) { | |
| var json = record.toJSON(); | |
| json.id = 1; | |
| store.didCreateRecord(record, json); |
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 'http://rubygems.org' | |
| gem 'guard' | |
| gem 'guard-shell' |
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
| # app/views/posts/new.html.erb | |
| <%= form_for(Post.new) do |form| %> | |
| Title: <%= form.text_field :title %> | |
| Body: <%= form.text_field :body %> | |
| <% end %> | |
| ...would produce a signature field that can be used to automatically untaint: | |
| <input type="hidden" name="signature" value="...."> |
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
| #To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883 | |
| linecache19-0.5.13.gem | |
| ruby_core_source-0.1.5.gem | |
| ruby-debug19-0.11.6.gem | |
| ruby-debug-base19-0.11.26.gem | |
| #Then in your console | |
| export RVM_SRC=/your/path/to/ruby-1.9.3 |