Last active
October 31, 2016 04:35
-
-
Save kellysutton/970d40a66ecd8b92ecc1990c703d0d54 to your computer and use it in GitHub Desktop.
strict-templates-examples
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
| class ApplicationController < ActionController::Base | |
| include StrictTemplates::Concern | |
| end |
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
| <%# app/views/blogs/show.html.erb %> | |
| <% @blog.posts.each do |post| %> | |
| <%= post.title %><br /> | |
| <% end %> |
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
| class BlogsController < ApplicationController | |
| def show | |
| @blog = Blog.includes(:posts).find(params[:id]) | |
| end | |
| end |
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
| class BlogsController < ApplicationController | |
| def show | |
| @blog = Blog.find(params[:id]) | |
| end | |
| end |
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
| gem 'strict_templates' |
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
| SELECT "posts".* FROM "posts" WHERE "posts"."blog_id" = $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment