Using Rails' tag helpers instead of bare HTML

This commit is contained in:
Christoph Haas 2013-08-25 08:35:58 +02:00
parent 5f238d2ec1
commit 869b87bc7b
2 changed files with 9 additions and 1 deletions

View file

@ -16,5 +16,5 @@ jQuery ->
})
# Submit the form if the user changes the view (grid or list)
$("input[name='display']").change ->
$("input[name='search[display]']").change ->
$(this).parents('form').submit()

View file

@ -28,6 +28,14 @@
<button type="submit" class="btn btn-default">Submit</button>
<div class="btn-group" data-toggle="buttons">
<%= label('search', 'display', class: 'btn btn-default') do %>
<%= radio_button('search', 'display', 'grid') %>
<span class="glyphicon glyphicon-th">
<% end %>
<%= label('search', 'display', class: 'btn btn-default') do %>
<%= radio_button('search', 'display', 'list') %>
<span class="glyphicon glyphicon-th-list">
<% end %>
<label class="btn btn-default active">
<input type="radio" name="display" value="grid"><span class="glyphicon glyphicon-th"></span>
</label>