- Use
Jamfileto list jam dependencies. - Create a temp
package.jsonwith correctbaseURL, etc. - Install external dependencies to
app/assets/javascripts/lib/ - Convert tag helper to add files in asset lib dir to requirejs config
- Fix compilation to include digests
- Update helper to check for digests.yml file
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
| record = Post.new(:title => 'Yay', :body => 'This is some insert SQL') | |
| # easiest way to achieve this is by calling protected #arel_attributes_values (tested in | |
| # rails 3.2.13). the alternative is to build the entire insert statement using arel >_> | |
| record.class.arel_table.create_insert \ | |
| .tap { |im| im.insert(record.send(:arel_attributes_values, false)) } \ | |
| .to_sql |
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.
The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.
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
| =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') |
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
| In response to all the responses to: | |
| http://twitter.com/rtomayko/status/1155906157 | |
| You should never do this in a source file included with your library, | |
| app, or tests: | |
| require 'rubygems' | |
| The system I use to manage my $LOAD_PATH is not your library/app/tests |
NewerOlder