Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
marking the added example code in each project (rails3/rails4) - the …
Browse files Browse the repository at this point in the history
…code is identical but behaves differently.
  • Loading branch information
coldnebo committed Nov 14, 2014
1 parent 8c1b14b commit 3f4b135
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions rails3_version/app/helpers/application_helper.rb
@@ -1,5 +1,6 @@
module ApplicationHelper

# example
def working_helper
%{alert('hello');}.html_safe
end
Expand Down
@@ -1 +1,2 @@
// example
alert('from a render_to_string');
1 change: 1 addition & 0 deletions rails3_version/app/views/content_test/example.html.erb
@@ -1,6 +1,7 @@
<h1>ContentTest#example</h1>
<p>Find me in app/views/content_test/example.html.erb</p>

<!-- example -->
<% content_for(:javascript) do %>
<%= working_helper %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions rails3_version/app/views/layouts/application.html.erb
Expand Up @@ -8,6 +8,7 @@
</head>
<body>

<!-- example -->
<script><%= yield(:javascript) %></script>
<script><%= yield(:javascript2) %></script>
<pre>Layout yield :javascript: <%= yield(:javascript).inspect %></pre>
Expand Down
1 change: 1 addition & 0 deletions rails4_version/app/helpers/application_helper.rb
@@ -1,5 +1,6 @@
module ApplicationHelper

# example
def working_helper
%{alert('hello');}.html_safe
end
Expand Down
@@ -1 +1,2 @@
// example
alert('from a render_to_string');
1 change: 1 addition & 0 deletions rails4_version/app/views/content_test/example.html.erb
@@ -1,6 +1,7 @@
<h1>ContentTest#example</h1>
<p>Find me in app/views/content_test/example.html.erb</p>

<!-- example -->
<% content_for(:javascript) do %>
<%= working_helper %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions rails4_version/app/views/layouts/application.html.erb
Expand Up @@ -8,6 +8,7 @@
</head>
<body>

<!-- example -->
<script><%= yield(:javascript) %></script>
<script><%= yield(:javascript2) %></script>
<pre>Layout yield :javascript: <%= yield(:javascript).inspect %></pre>
Expand Down

0 comments on commit 3f4b135

Please sign in to comment.