3 ms·
Any secret sauce in not worrying about rails 3 forgery protection?
by steele 16y ago
Any secret sauce in not worrying about rails 3 forgery protection?
- steveklabnik 16y agoHis example app is running Rails 2.3.8, and also includes this little option that's important: ActiveRecord::Base.include_root_in_json = false If that's not in your environment, it changes the JSON from {"id":n, ... to {"doument":{"id":n,..., which is kind of a big difference. James, I'd consider adding a note about this to your tutorial. Also, the link to your GitHub is a fake one; I managed to guess it properly though. Oh, and all of your commits show you as both the committer and the author, I think your git config is wrong. Make sure git config --global author.email is your github email.
- jamesjyu 16y agoOh man, that is embarrassing. Link is fixed now. I'll add a note about the json later.
- steveklabnik 16y agoNo worries, it happens to everyone. :D
- steele 16y agoI only ask because cross-site request forgery protection is enabled by default in Rails 3 and require some extra coaxing with its authenticity token. Since this is in Rails 2.3.8 as you've highlighted, it's a moot point.