summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-23 20:09:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-23 20:09:57 +0000
commit3e0936606ec9f48030ecd85ecc7be899bac0ae3c (patch)
treeda66e93deb1c2ff29ed37769118771a26b8aa8c1
parent8b7de1e400325bebc9f3a0a5f943307d649929e3 (diff)
downloadredmine-3e0936606ec9f48030ecd85ecc7be899bac0ae3c.tar.gz
redmine-3e0936606ec9f48030ecd85ecc7be899bac0ae3c.zip
Removed object name from form_for arguments.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7904 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/news_controller.rb5
-rw-r--r--app/views/news/edit.html.erb3
-rw-r--r--app/views/news/index.html.erb2
-rw-r--r--app/views/news/new.html.erb2
4 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index 492ca09a6..0d091396a 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -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
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb
index 0b069862f..83608f971 100644
--- a/app/views/news/edit.html.erb
+++ b/app/views/news/edit.html.erb
@@ -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),
diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb
index d4c032689..fe8534130 100644
--- a/app/views/news/index.html.erb
+++ b/app/views/news/index.html.erb
@@ -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) %>
diff --git a/app/views/news/new.html.erb b/app/views/news/new.html.erb
index 59589030a..55a876d27 100644
--- a/app/views/news/new.html.erb
+++ b/app/views/news/new.html.erb
@@ -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) %>