-
Add to
.gitignore
:node_modules public
-
Add to your app
dependencies
ofpackage.json
:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
require 'test_helper' | |
shared_examples_for 'An Adapter' do | |
describe '#read' do | |
before do | |
@adapter.write(@key = 'whiskey', @value = "Jameson's") | |
end | |
it 'reads a given key' do | |
@adapter.read(@key).must_equal(@value) |
gg_replace() { | |
if [[ "$#" == "0" ]]; then | |
echo 'Usage:' | |
echo ' gg_replace term replacement file_mask' | |
echo | |
echo 'Example:' | |
echo ' gg_replace cappuchino cappuccino *.html' | |
echo | |
else | |
find=$1; shift |
require 'action_dispatch/middleware/static' | |
module Middleware | |
class FileHandler < ActionDispatch::FileHandler | |
def initialize(root, assets_path, cache_control) | |
@assets_path = assets_path.chomp('/') + '/' | |
super(root, cache_control) | |
end | |
def match?(path) |
Add to .gitignore
:
node_modules
public
Add to your app dependencies
of package.json
:
curl \ | |
--verbose \ | |
--request OPTIONS \ | |
http://localhost:3001/api/configuration/visitor \ | |
--header 'Origin: http://localhost:9292' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: GET' | |
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE |
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
/** @jsx React.DOM */ | |
var STATES = [ | |
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
] | |
var BootstrapRadioInlineRenderer = forms.RadioFieldRenderer.extend({ |