update action problem

Im having problem with update action in my controller when the updated text includes word 'from'. here is message i get: Processing ApplicationController#index (for 78.1.131.245 at 2010-11-13 19:11:09) [GET]   Parameters: {"commit"=>"Submit", "_method"=>"put", "authenticity_token"=>"/rQ3EmaRkSEZpM7oCLqBGqyHV18qKJZURiLGTjSaImU=", "page"=>{"background_id"=>"161", "content_en"=>"a London-based architect originally from Hong Kong.", "title_en"=>"Gatehouse Room"}}

ActionController::RoutingError (No route matches "/500.shtml" with {:method=>:get}):

If I exclude word from, i got this: Processing PagesController#update (for 78.1.131.245 at 2010-11-13 19:16:30) [PUT]   Parameters: {"commit"=>"Submit", "action"=>"update", "_method"=>"put", "authenticity_token"=>"/ rQ3EmaRkSEZpM7oCLqBGqyHV18qKJZURiLGTjSaImU=", "id"=>"22", "page"=>{"background_id"=>"161", "content_en"=>"London-based architect originally Hong Kong.", "title_en"=>"Gatehouse Room"}, "controller"=>"pages"}

The first one is processing ApplicationController#index, the second PagesController#update. I don't think you should be processing actions in ApplicationController.

Colin

The first one is processing ApplicationController#index, the second PagesController#update. I don't think you should be processing actions in ApplicationController.

Colin

But the code is the same, the only difference is what user is entering inside text_area. View code: <% form_for @page do |f| %>   <%= f.error_messages %>   <p>     <div id='en' >       <strong><%= f.label :title_en %><br /></strong>       <%= f.text_field :title_en %><br />       <strong><%= f.label 'Tooltip' %><br /></strong>       <%= f.text_field :short_en %><br />     <strong><%= f.label :content_en %></strong><br />       <%= f.text_area :content_en%>   </div> <p><%= f.submit "Submit" %></p> <%end%>

It looks like, somehow, rails is processing entered text_area input as some kind of SQL query.

Please remember to quote the previous message so that each message makes some sense in it's own right, otherwise we have to search back through previous messages to work out what you are talking about.

I would concentrate on finding out why (if) it is calling the wrong action first. What happens after is irrelevant if it is calling the wrong action. No SQL or anything else is performed before the 'Processing ....' message is logged.

By the way have you actually got actions inside ApplicationController? This would be unusual I think. Though I may be wrong.

Colin

The first one is processing ApplicationController#index, the second PagesController#update. I don't think you should be processing actions in ApplicationController.

Colin

But the code is the same, the only difference is what user is entering inside text_area.

Are you sure you are interpreting the log correctly? Have a look before the 'processing ApplicationController#index' and check that the submit is not there.

Colin

Hi Colin, thanks for interest to help :slight_smile:

In my application_controller.rb i have this: class ApplicationController < ActionController::Base   before_filter { |c| Authorization.current_user = c.current_user }   before_filter :set_locale   helper :all # include all helpers, all the time   protect_from_forgery

  def set_locale     I18n.locale = 'en'   end   include Authentication

protected

  def permission_denied     flash[:error] = "This action is not allowed."     redirect_to login_url   end end

MoonFlash, I was wondering if you solved this. I am having the same problem and can't figure it out.