1<% unless @starred_stories.empty? %> 2 <% if @starred_stories.total_pages > 1 %> 3 <%= render_js :stories, { stories: @starred_stories } %> 4 <% end %> 5<% end %> 6 7<div> 8 <%= mail_to("", 9 "Email to a friend", 10 :subject => @listing.display_title, 11 body: "I found this listing online, and thought you might be interested:\n#{@listing.url}", 12 :class => 'mail') %> 13</div> 14 15<div> 16 <div> 17 <% 18 a = [ 19 [1, 2], 20 [3, 4] 21 ] 22 b = 10 23 %> 24 </div> 25</div> 26 27<div id='header'> 28 <% if signed_in? -%> 29 <%= link_to t('.sign_out'), sign_out_path, :method => :delete %> 30 <% else -%> 31 <%= link_to t('.sign_in'), sign_in_path %> 32 <% end -%> 33</div> 34 35<div id='flash'> 36 <% flash.each do |key, value| -%> 37 <div id='flash_<%= key %>'><%=h value %></div> 38 <% end %> 39</div> 40 41<div> 42 <% if request.xhr? %> 43 <span></span> 44 <% end %> 45</div> 46 47 48<% 49if foo 50 puts "foo" 51 puts "foo" 52 53 54 puts "foo" 55 puts "foo" 56end 57 58$age = 5 59case $age 60when 0 .. 2 61 puts "baby" 62when 3 .. 6 63 puts "little child" 64when 7 .. 12 65 puts "child" 66when 13 .. 18 67 puts "youth" 68else 69 puts "adult" 70end 71 72class Greeter 73 74 def initialize(name = "World") 75 @name = name 76 end 77 78 def say_hi 79 puts "Hi #{@name}!" 80 end 81 82 def say_bye 83 puts "Bye #{@name}, come back soon." 84 end 85 86end 87 88x=1 89if x > 2 90 puts "x is greater than 2" 91elsif x <= 2 and x!=0 92 puts "x is 1" 93else 94 puts "I can't guess the number" 95end 96 97%> 98 99<% if request.xhr? %> 100 <div class="reloadable"></div> 101<% end %> 102 103 104<div> 105 <% if request.xhr? %> 106 <span></span> 107 <% else %> 108 <p></p> 109 <% end %> 110</div> 111 112<% @hash.each do |t, a| %> 113 <h2><%= t %></h2> 114 <% a.each do |q| %> 115 <%= link_to(q.question_answers_url) %> </br> 116 <% end %> 117<% end %> 118 119 120<ul> 121 <% for @item in @shopping_list %> 122 <li><%= @item %></li> 123 <% end %> 124</ul> 125