View cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-26 17:56:52 +00:00
parent 5a1fcf826f
commit 0e2733a7cb
4 changed files with 10 additions and 3 deletions

View File

@ -871,6 +871,13 @@ module ApplicationHelper
form_for(*args, &proc)
end
def labelled_form_for(*args, &proc)
args << {} unless args.last.is_a?(Hash)
options = args.last
options.merge!({:builder => TabularFormBuilder})
form_for(*args, &proc)
end
def back_url_hidden_field_tag
back_url = params[:back_url] || request.env['HTTP_REFERER']
back_url = CGI.unescape(back_url.to_s)

View File

@ -1,4 +1,4 @@
<% labelled_tabular_form_for :group, @group, :url => group_path(@group), :html => {:method => :put} do |f| %>
<% labelled_form_for @group do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -14,7 +14,7 @@
<tbody>
<% @groups.each do |group| %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%= link_to h(group), :action => 'edit', :id => group %></td>
<td><%= link_to h(group), edit_group_path(group) %></td>
<td align="center"><%= group.users.size %></td>
<td class="buttons"><%= link_to l(:button_delete), group, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %></td>
</tr>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_group_plural), groups_path %> &#187; <%= l(:label_group_new) %></h2>
<% form_for(@group, :builder => TabularFormBuilder, :lang => current_language) do |f| %>
<% labelled_form_for @group do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p>
<%= f.submit l(:button_create) %>