]> source.dussan.org Git - redmine.git/commitdiff
View cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 26 Nov 2011 17:56:52 +0000 (17:56 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 26 Nov 2011 17:56:52 +0000 (17:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7939 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/views/groups/_general.html.erb
app/views/groups/index.html.erb
app/views/groups/new.html.erb

index 6878932ef179d6968395e8fa07de7e7994c0b6e7..45ce61175e3306a1958783046127e7449bd61c68 100644 (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)
index f13ef32df9926bbfb628d27e06577e031daf25dc..a9d05b7ca5899275c4aaefbd782bacc6df5614fe 100644 (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 %>
index 48b9ab42d5c0fa2caffda4568ca0cda001f27aa8..418563abd2b0cf19d005ca0688b79df7bdd2dad3 100644 (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>
index c200f5bdf88e501172f25af605d051b3cff454ed..a4426f2d14200c5eacf530bd51579765f9b8db3f 100644 (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) %>