Skip to content

Instantly share code, notes, and snippets.

@ahhqx
ahhqx / comments.md
Created August 2, 2011 04:32
Rails 3.0.9 model/controller ready to use with Backbonejs

Do not include root in json

Add ActiveRecord::Base.include_root_in_json = false in an initializer (or config/environment.rb)

Model

Model should use attr_accessible in order to filter the parameter correctly In the example we use the model Task which only accessible attribute : name

@ahhqx
ahhqx / LICENSE.txt
Created June 29, 2011 13:15 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ahhqx
ahhqx / CSS3 Media Queries Template
Created June 29, 2011 11:34
CSS3 Media Queries template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}