major refactoring of javascripts

This commit is contained in:
albert
2011-03-10 17:59:42 -05:00
parent efa6856b4a
commit 9c0a961ab2
28 changed files with 168 additions and 415 deletions

View File

@@ -9,11 +9,9 @@ class FavoritesController < ApplicationController
def create
Post.find(params[:id]).add_favorite(CurrentUser.user)
render :nothing => true
end
def destroy
Post.find(params[:id]).remove_favorite(CurrentUser.user)
render :nothing => true
end
end

View File

@@ -1,17 +1,12 @@
class TagAliasesController < ApplicationController
before_filter :admin_only, :only => [:new, :edit, :create, :update, :destroy]
respond_to :html, :xml, :json
before_filter :admin_only, :only => [:new, :create, :destroy]
respond_to :html, :xml, :json, :js
def new
@tag_alias = TagAlias.new(params[:tag_alias])
respond_with(@tag_alias)
end
def edit
@tag_alias = TagAlias.find(params[:id])
respond_with(@tag_alias)
end
def index
@search = TagAlias.search(params[:search])
@tag_aliases = @search.paginate(:page => params[:page])
@@ -20,19 +15,13 @@ class TagAliasesController < ApplicationController
def create
@tag_alias = TagAlias.create(params[:tag_alias])
respond_with(@tag_alias)
end
def update
@tag_alias = TagAlias.find(params[:id])
@tag_alias.update_attributes(params[:tag_alias])
respond_with(@tag_alias)
respond_with(@tag_alias, :location => tag_aliases_path(:search => {:id_eq => @tag_alias.id}))
end
def destroy
@tag_alias = TagAlias.find(params[:id])
@tag_alias.destroy
respond_with(@tag_alias)
respond_with(@tag_alias, :location => tag_aliases_path)
end
def cache

View File

@@ -1,32 +1,21 @@
class TagImplicationsController < ApplicationController
before_filter :admin_only, :only => [:new, :edit, :create, :update, :destroy]
respond_to :html, :xml, :json
before_filter :admin_only, :only => [:new, :create, :destroy]
respond_to :html, :xml, :json, :js
def new
@tag_implication = TagImplication.new
respond_with(@tag_implication)
end
def edit
@tag_implication = TagImplication.find(params[:id])
respond_with(@tag_implication)
end
def index
@search = TagImplication.search(params[:search])
@tag_implicationes = @search.paginate(:page => params[:page])
@tag_implications = @search.paginate(:page => params[:page])
respond_with(@tag_implicationes)
end
def create
@tag_implication = TagImplication.create(params[:tag_implication])
respond_with(@tag_implication)
end
def update
@tag_implication = TagImplication.find(params[:id])
@tag_implication.update_attributes(params[:tag_implication])
respond_with(@tag_implication)
respond_with(@tag_implication, :location => tag_implications_path(:search => {:id_eq => @tag_implication.id}))
end
def destroy