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
c. Rails 3.2.6 | |
In development.rb: | |
config.assets.debug = false |
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
c. Rails 3.x | |
e.g. for a model User | |
class_name = "User" | |
klass = class_name.constantize | |
klass.find some_id | |
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
make sure database is clean, as sometimes causes funny errs if not | |
- e.g. was trying to create objs, but failed silently on a uniqueness constraint, so bombed when supposedly created models asked for their ids |
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
Ref: https://devcenter.heroku.com/articles/custom-domains | |
For naked domains, fairly simple: | |
1. Add domain to heroku | |
$ heroku domains:add www.example.com | |
2. Add separate A records for each of the following addresses using your DNS management tool (e.g. at godaddy or where your domain name hosted): | |
75.101.163.44 |
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
Version: Rails 3.2.1 | |
TypeError: Cannot visit Videoset | |
Happens when specify class for id in validations (perhaps other places), e.g.: | |
INCORRECT | |
validates_uniqueness_of :song_num, :scope=>[:videoset] | |
CORRECT | |
validates_uniqueness_of :song_num, :scope=>[:videoset_id] |
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
Install: gem install rails_apps_composer | |
Create app example: | |
rails_apps_composer new atm -r devise git haml heroku rails_admin rspec sass seed_database add_user home_page | |
List Recipes: rails_apps_composer list | |
Additional Steps | |
- gemfile | |
- If using pg: create db |
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
ActionView::MissingTemplate (Missing template...) | |
To fix this, make sure have a render such as: | |
format.json { render :json=>json_to_render } | |
If leave out the :json=> will get error | |
Seems if just do respond_to :json and return @someObj will get error |
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
This seems to come from haml.js | |
Not sure the quintessential case, but I had problems when calling JSON.stringify with a string with an apostrophe in in. Apparentely JSON.stringify can't handle apostrophes. |
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
Circa: 1.1.0rc1 | |
If have href='#', e.g. %a{href: '#', id: 'mylink'}, jqm will not fire an event so callback $('#mylink').click won't get called. | |
Instead do %a{href: 'javascript:myFunction()', ...} | |
Ref: http://forum.jquery.com/topic/how-can-i-create-buttons-that-execute-some-javascript-without-linking-to-any-address | |
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
Used on: Rails 3.2.1 | |
If you have more than one set of assets to precompile, need to add using config.assets.precompile | |
E.g. if have mobile.css and mobile.js to precomp, do the following | |
In config/environments/production.rb (or whenver env you want precompiled) | |
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) |