File: index.erb

package info (click to toggle)
ruby-rack-flash3 1.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 160 kB
  • ctags: 51
  • sloc: ruby: 296; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<% if flash.has?(:err) %>
  <h3 class="err"><%= flash[:err] %></h3>
<% end %>

<% if flash.has?(:ok) %>
  <h3 class="ok"><%= flash[:ok] %></h3>
<% end %>

<% [:notice, :error, :success, :whatevz, :bliggety].each do |name| %>
  <form action="/<%= name %>" method="post" accept-charset="utf-8">
    <label>
      <span>
        <% if flash.has?(name) %>
          <a href="/<%= name %>">View Current</a>
        <% end %>
        
        Set <code>flash[:<%= name %>]</code>
        
        <% if err = flash["err_on_#{name}"] %>
          <strong class="err_on">Required!</strong>
        <% end %>
      </span>
      <input type="text" name="message" value="" id="message">
    </label>
    
    <input type="submit" value="Set Flash">
  </form>
<% end %>