This one needs a nice test
This commit is contained in:
Reinier Balt 2008-08-18 16:02:13 +02:00
parent 2a6b8f1cd9
commit b2e82ea6b6
9 changed files with 38 additions and 3 deletions

View file

@ -83,10 +83,14 @@ class ContextsController < ApplicationController
end
@context.attributes = params["context"]
if @context.save
if params['wants_render']
if boolean_param('wants_render')
respond_to do |format|
format.js
end
elsif boolean_param('update_context_name')
@contexts = current_user.projects
render :template => 'contexts/update_context_name.js.rjs'
return
else
render :text => success_text || 'Success'
end

View file

@ -136,6 +136,10 @@ class ProjectsController < ApplicationController
@initial_context_name = @project.default_context.name
render :template => 'projects/update_default_context.js.rjs'
return
elsif boolean_param('update_project_name')
@projects = current_user.projects
render :template => 'projects/update_project_name.js.rjs'
return
else
render :text => success_text || 'Success'
return

View file

@ -89,6 +89,7 @@ class TodosController < ApplicationController
@contexts = current_user.contexts.find(:all) if @new_context_created
@projects = current_user.projects.find(:all) if @new_project_created
@initial_context_name = params['default_context_name']
@initial_project_name = params['default_project_name']
render :action => 'create'
end
format.xml do