mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-16 14:15:28 +01:00
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:
parent
2796e3a4eb
commit
d6ac8086d6
9 changed files with 125 additions and 69 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue