Skip to content

Commit

Permalink
fixes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
kawasima committed Jul 11, 2012
1 parent 5273cb4 commit 950b56f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions app/controllers/impasse_settings_controller.rb
Expand Up @@ -6,14 +6,10 @@ class ImpasseSettingsController < ImpasseAbstractController
def index
end

def show
@setting = Impasse::Setting.find_or_create_by_project_id(@project)
end

def edit
@setting = Impasse::Setting.find_or_create_by_project_id(@project)
@setting = Impasse::Setting.find_or_create_by_project_id(:project_id => @project.id)
@setting.attributes = params[:setting]
@setting.save if request.post?
@setting.save if request.put? or request.post?
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => '/projects', :action => 'settings', :id => @project, :tab => 'impasse'
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/impasse_settings/_show.html.erb
@@ -1,10 +1,9 @@
<%
@impasse_setting = Impasse::Setting.find_or_create_by_project_id(@project)
@impasse_setting = Impasse::Setting.find_or_create_by_project_id(:project_id => @project.id)
%>
<% if Rails::VERSION::MAJOR < 3 %>
<% remote_form_for :setting, @impasse_setting,
<% labelled_form_for :setting, @impasse_setting,
:url => {:controller => :impasse_settings, :action => :edit, :project_id => @project },
:builder => TabularFormBuilder,
:lang => current_language do |f| %>
<%= error_messages_for 'setting' %>
<div class="box tabular">
Expand All @@ -14,7 +13,8 @@
<%= submit_tag l(:button_save) %>
<% end %>
<% else %>
<% output = remote_form_for :setting, @impasse_setting,
<% output = labelled_form_for @impasse_setting,
:as => :setting,
:url => {:controller => :impasse_settings, :action => :edit, :project_id => @project },
:lang => current_language do |f| %>
<%= error_messages_for 'setting' %>
Expand Down

0 comments on commit 950b56f

Please sign in to comment.