SUZUKI Miho
null+****@clear*****
Fri Sep 28 14:14:06 JST 2012
SUZUKI Miho 2012-09-28 14:14:06 +0900 (Fri, 28 Sep 2012) New Revision: c94008320f04fd4bb6f250ff04e03a868e7f836f https://github.com/logaling/logaling-server/commit/c94008320f04fd4bb6f250ff04e03a868e7f836f Log: Remove #set_my_glossaries Modified files: app/controllers/user_glossaries_controller.rb app/views/user_glossaries/_form.html.haml Modified: app/controllers/user_glossaries_controller.rb (+0 -6) =================================================================== --- app/controllers/user_glossaries_controller.rb 2012-09-28 13:15:05 +0900 (68f9dca) +++ app/controllers/user_glossaries_controller.rb 2012-09-28 14:14:06 +0900 (e6744bb) @@ -2,7 +2,6 @@ class UserGlossariesController < ApplicationController before_filter :authenticate!, :except => :show before_filter :valid_user?, :only => [:new, :create] - before_filter :set_my_glossaries, :only => [:new, :create] # GET /user_glossaries/1 def show @@ -38,9 +37,4 @@ class UserGlossariesController < ApplicationController rescue ActiveRecord::RecordNotFound render :file => 'public/404.html', :status => 404, :layout => false end - - private - def set_my_glossaries - @my_glossaries = signed_in? ? current_user.user_glossaries : [] - end end Modified: app/views/user_glossaries/_form.html.haml (+4 -5) =================================================================== --- app/views/user_glossaries/_form.html.haml 2012-09-28 13:15:05 +0900 (12ad021) +++ app/views/user_glossaries/_form.html.haml 2012-09-28 14:14:06 +0900 (c57f0a5) @@ -6,11 +6,10 @@ - @user_glossary.errors.full_messages.each do |msg| %li= msg - - if signed_in? && !@my_glossaries.empty? - .control-group - = f.label :original_user_glossary_id, :class => 'control-label' - .controls - = f.collection_select :original_user_glossary_id, @my_glossaries, :id, :name, :prompt => true + .control-group + = f.label :original_user_glossary_id, :class => 'control-label' + .controls + = f.collection_select :original_user_glossary_id, current_user.user_glossaries, :id, :name, :prompt => true .control-group = f.label :name, :class => 'control-label required' .controls -------------- next part -------------- An HTML attachment was scrubbed... Télécharger