Last active
November 5, 2015 14:15
-
-
Save mdmartinez/0335873446d75519803a to your computer and use it in GitHub Desktop.
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
| ## Fresh App Stuff | |
| rails new myapp --database=postgresql -T | |
| ## Gemfile add: rspec, factory_girl, capybara, bcrypt | |
| gem 'rspec-rails', '~> 3.0' | |
| ## Delete all references to turbolinks | |
| Bundle | |
| rails g rspec:install | |
| # Testing | |
| rspec | |
| rails generate rspec:model widget | |
| # Make a resource | |
| ## generate resource | |
| rails g resource User email:string:index password_digest:string | |
| set null: false | |
| ## model user | |
| class User < AR::BASE | |
| has_secure_password #bcrpyt helper | |
| end | |
| # json in controller | |
| def index | |
| @tasks = Task.all | |
| respond_to do |format| | |
| format.html | |
| format.json | |
| end | |
| end | |
| # basic api call | |
| function basicApiCall() { | |
| $.ajax({ | |
| url: '', | |
| type: 'GET', | |
| data: {} | |
| }).done(function(data){ | |
| $('.message').html("<h2>GitHub save success!</h2>"); | |
| }).error(function(error) { | |
| $('.message').html("<h2>"+ error +"</h2>"); | |
| }); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment