[logaling-commit] logaling/logaling-server [master] Remove unused code

Back to archive index

SHIMADA Koji null+****@clear*****
Fri Sep 21 13:49:29 JST 2012


SHIMADA Koji	2012-09-21 13:49:29 +0900 (Fri, 21 Sep 2012)

  New Revision: a5f0a3bbee34571d10fa207d0733c73bd45f434d
  https://github.com/logaling/logaling-server/commit/a5f0a3bbee34571d10fa207d0733c73bd45f434d

  Merged c5d082c: Merge pull request #13 from logaling/enable-creating-user-glossary

  Log:
    Remove unused code

  Modified files:
    app/controllers/user_glossaries_controller.rb

  Modified: app/controllers/user_glossaries_controller.rb (+3 -16)
===================================================================
--- app/controllers/user_glossaries_controller.rb    2012-09-21 13:46:56 +0900 (63d8388)
+++ app/controllers/user_glossaries_controller.rb    2012-09-21 13:49:29 +0900 (8c504af)
@@ -11,32 +11,19 @@ class UserGlossariesController < ApplicationController
   end
 
   # GET /user_glossaries/new
-  # GET /user_glossaries/new.json
   def new
     @user_glossary = UserGlossary.new
-
-    respond_to do |format|
-      format.html
-      format.json { render json: @user_glossary }
-    end
   end
 
   # POST /user_glossaries
-  # POST /user_glossaries.json
   def create
     @user_glossary = current_user.user_glossaries.build(params[:user_glossary])
     @user_glossary.save!
 
-    respond_to do |format|
-      format.html { redirect_to user_glossary_path(current_user, @user_glossary), notice: 'User glossary was successfully created.' }
-      format.json { render json: @user_glossary, status: :created, location: @user_glossary }
-    end
+    redirect_to user_glossary_path(current_user, @user_glossary), notice: 'User glossary was successfully created.'
   rescue => e
-    respond_to do |format|
-      @user_glossary.errors.add(:name, e) if @user_glossary.errors.empty?
-      format.html { render action: "new" }
-      format.json { render json: @user_glossary.errors, status: :unprocessable_entity }
-    end
+    @user_glossary.errors.add(:name, e) if @user_glossary.errors.empty?
+    format.html { render action: "new" }
   end
 
   private
-------------- next part --------------
An HTML attachment was scrubbed...
下載 



More information about the logaling-commit mailing list
Back to archive index