Removed object name from form_for arguments.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7904 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-23 20:09:57 +00:00
parent 8b7de1e400
commit 3e0936606e
4 changed files with 7 additions and 5 deletions

View File

@ -47,7 +47,10 @@ class NewsController < ApplicationController
:limit => @limit)
respond_to do |format|
format.html { render :layout => false if request.xhr? }
format.html {
@news = News.new # for adding news inline
render :layout => false if request.xhr?
}
format.api
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end

View File

@ -1,7 +1,6 @@
<h2><%=l(:label_news)%></h2>
<% labelled_tabular_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :method => :put } do |f| %>
<% labelled_tabular_form_for @news, :html => { :id => 'news-form', :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview),

View File

@ -7,7 +7,7 @@
<div id="add-news" style="display:none;">
<h2><%=l(:label_news_new)%></h2>
<% labelled_tabular_form_for :news, @news, :url => project_news_index_path(@project),
<% labelled_tabular_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form' } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_news_new)%></h2>
<% labelled_tabular_form_for :news, @news, :url => project_news_index_path(@project),
<% labelled_tabular_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form' } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>