Adds ability to parse plain-text tags

Tags that haven't been autocompleted and clicked on will be
added as tags as well. There should only be one tag like this
at a time, since adding a space between tags turns it into
a list item.
This commit is contained in:
Alex Chvatal 2011-06-22 12:31:24 -04:00
parent 58ba4db3c8
commit 7a56322b60

View file

@ -20,6 +20,7 @@ class ProfilesController < ApplicationController
def update def update
# upload and set new profile photo # upload and set new profile photo
params[:profile] ||= {} params[:profile] ||= {}
params[:tags] << params[:profile][:tag_string] unless params[:profile][:tag_string].nil?
params[:profile][:tag_string] = (params[:tags]) ? params[:tags].gsub(',',' ') : "" params[:profile][:tag_string] = (params[:tags]) ? params[:tags].gsub(',',' ') : ""
params[:profile][:searchable] ||= false params[:profile][:searchable] ||= false
params[:profile][:photo] = Photo.where(:author_id => current_user.person.id, params[:profile][:photo] = Photo.where(:author_id => current_user.person.id,