Show More
Commit Description:
wip: bootstrap toggle switch...
Commit Description:
wip: bootstrap toggle switch todo: add javascript that thisable button until reponse arrived
File last commit:
Show/Diff file:
Action:
app/views/announcements/index.html.erb | 41 lines | 1.4 KiB | text/plain | TextLexer |
<h1>Listing announcements</h1>
<%= link_to 'New announcement', new_announcement_path %>
<table class="info">
<tr class="info-head">
<th>Updated</th>
<th>Announcement</th>
<th>Author</th>
<th>Published</th>
<th></th>
<th></th>
<th></th>
</tr>
<% for announcement in @announcements %>
<tr class="info-<%= cycle 'odd', 'even' %>">
<% @announcement = announcement %>
<td><%= time_ago_in_words announcement.updated_at %></td>
<td>
<% if !announcement.title.blank? %>
<b>Title:</b> <%=h announcement.title %><br/>
<% end %>
<% if !announcement.notes.blank? %>
<b>Notes: <%=h announcement.notes %></b><br/>
<% end %>
<%=h announcement.body %>
</td>
<td><%=h announcement.author %></td>
<td><%= check_box_tag :published, 1, announcement.published, { class: 'bootstrap-toggle', id: "published-#{announcement.id}", data: {remote: true, method: 'PUT', url: url_for(controller: :announcements, action: :toggle, id: announcement), size: 'small', toggle: 'toggle' } } %></td>
<!-- <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> -->
<td><%= link_to 'Show', announcement %></td>
<td><%= link_to 'Edit', edit_announcement_path(announcement) %></td>
<td><%= link_to 'Destroy', announcement, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New announcement', new_announcement_path %>