Skip to content

Commit

Permalink
It is much better to use rails helpers to create forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielegozzi committed Jun 18, 2008
1 parent 4fd26d4 commit 2a9b821
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion page_group_permissions/app/views/admin/group/edit.html.erb
Expand Up @@ -4,7 +4,7 @@
<h1 id="edit_page">Edit Group</h1>
<% end -%>
<% form_for :group do |f| %>
<% form_for :group, :method => 'post' do |f| %>
<table class="fieldset" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="label"><label for="group_name">Name</label></td>
Expand Down
4 changes: 2 additions & 2 deletions page_group_permissions/app/views/admin/group/index.html.erb
Expand Up @@ -67,12 +67,12 @@
<small class="note"><%=h group.notes %></small>
</td>
<td class="add-child">
<form method="post" action="<%= group_add_member_url :id => group %>">
<% form_tag group_add_member_url(:id => group) do %>
<select name="user_id", id="user_id">
<%= options_for_select User.find(:all, :order => 'name ASC').map{|u| [u.name, u.id]}.unshift(['—', '']) %>
</select>
<%= image_submit_tag('page_group_permissions/add-member.png', :alt => 'Add Group Member') %>
</form>
<% end %>
</td>
<td class="remove">
<%= link_to image('remove', :alt => 'Remove Group'), group_remove_url(:id => group) %>
Expand Down
4 changes: 2 additions & 2 deletions page_group_permissions/app/views/admin/group/remove.html.erb
Expand Up @@ -18,6 +18,6 @@
</tbody>
</table>

<form method="post" action="">
<% form_tag "", :method => 'post' do %>
<p class="buttons"><%= submit_tag "Delete Group", :class => 'button' %> or <%= link_to 'Cancel', group_index_url %></p>
</form>
<% end %>
@@ -1,6 +1,6 @@
<h1>Remove Member</h1>
<p>Are you sure you want to remove <strong><%=h @user.name %></strong> from the group <strong><%= @group.name %></strong>?</p>

<form method="post" action="">
<% form_tag "", :method => 'post' do %>
<p class="buttons"><%= submit_tag "Remove Member", :class => 'button' %> or <%= link_to 'Cancel', group_index_url %></p>
</form>
<% end %>

0 comments on commit 2a9b821

Please sign in to comment.