diff --git a/trool/app/controllers/messages_controller.rb b/trool/app/controllers/messages_controller.rb index d0934f1..a3004c2 100644 --- a/trool/app/controllers/messages_controller.rb +++ b/trool/app/controllers/messages_controller.rb @@ -1,6 +1,14 @@ +require 'ruby-debug' class MessagesController < ApplicationController def update @msg = Message.find params[:id] + + # TODO: learn ruby + fuzzy_arr = (params.keys.grep /fuzzy-\d+/) or [] + fuzzy_bool = params[fuzzy_arr.first] == "1" + + params[:msg] ||= {} + params[:msg].merge!( { :fuzzy => fuzzy_bool } ) @msg.update_attributes params[:msg] render :nothing => true end diff --git a/trool/app/views/pos/show.html.erb b/trool/app/views/pos/show.html.erb index 302b91b..339c8cd 100644 --- a/trool/app/views/pos/show.html.erb +++ b/trool/app/views/pos/show.html.erb @@ -28,8 +28,7 @@