[logaling-commit] logaling/logaling-server [prioritize-the-search] Remove unsupported format for now

Zurück zum Archiv-Index

SHIMADA Koji null+****@clear*****
Wed Sep 19 18:39:16 JST 2012


SHIMADA Koji	2012-09-19 18:39:16 +0900 (Wed, 19 Sep 2012)

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

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

  Log:
    Remove unsupported format for now

  Modified files:
    app/controllers/terms_controller.rb

  Modified: app/controllers/terms_controller.rb (+4 -14)
===================================================================
--- app/controllers/terms_controller.rb    2012-09-19 18:15:03 +0900 (0857913)
+++ app/controllers/terms_controller.rb    2012-09-19 18:39:16 +0900 (7b34b47)
@@ -2,28 +2,18 @@
 class TermsController < ApplicationController
   def new
     @term = Term.new
-
-    respond_to do |format|
-      format.html
-      format.json { render json: @term }
-    end
   end
 
   def create
     @term = Term.new(params[:term])
+
     @user_glossary = UserGlossary.find(params[:glossary_id])
     @user_glossary.add!(@term)
 
-    respond_to do |format|
-      format.html { redirect_to user_glossary_path(current_user, @user_glossary), notice: 'Term was successfully added.' }
-      format.json { render json: @user_glossary, status: :created, location: @user_glossary }
-    end
+    redirect_to user_glossary_path(current_user, @user_glossary), notice: 'Term was successfully added.'
   rescue => e
-    respond_to do |format|
-      @term.errors.add(:source_term, e) if****@term*****?
-      format.html { render action: "new" }
-      format.json { render json: @term.errors, status: :unprocessable_entity }
-    end
+    @term.errors.add(:source_term, e) if****@term*****?
+    render action: "new"
   end
 
   def edit
-------------- next part --------------
An HTML attachment was scrubbed...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index