Applied changes to context corresponding to yesterday's project changeset: tests, prohibit slashes, introduce RJS, relocate new context form.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@266 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-06-20 02:07:18 +00:00
parent 2796e3a4eb
commit d6ac8086d6
9 changed files with 125 additions and 69 deletions

View file

@ -35,16 +35,10 @@ class ContextController < ApplicationController
# Creates a new context via Ajax helpers
#
def new_context
context = @user.contexts.build
context.attributes = params['context']
context.name = deurlize(context.name)
if context.save
render :partial => 'context_listing', :locals => { :context_listing => context }
else
flash["warning"] = "Couldn't add new context"
render :text => "#{flash["warning"]}"
end
@context = @user.contexts.build
@context.attributes = params['context']
@context.name = deurlize(@context.name)
@saved = @context.save
end
# Called by a form button