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"}
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On 13 November 2010 18:24, MoonFlash <mladimisec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> The first one is processing ApplicationController#index, the second > PagesController#update. I don''t think you should be processing > actions in ApplicationController. > > ColinBut 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%> _______________________________ PagesController: def update @page = Page.find(params[:id]) if @page.update_attributes(params[:page]) flash[:notice] = t(''flash.page_edited'') redirect_to :action =>''index'' else render :action => ''edit'' end end On my localhost everything works OK. On the server when i enter text that includes .... select.......from... in text_area i got previous error ??? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
It looks like, somehow, rails is processing entered text_area input as some kind of SQL query. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 13 November 2010 23:14, MoonFlash <mladimisec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 13 November 2010 23:06, MoonFlash <mladimisec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> >> 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> 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%> > _______________________________ > PagesController: > def update > @page = Page.find(params[:id]) > > if @page.update_attributes(params[:page]) > flash[:notice] = t(''flash.page_edited'') > redirect_to :action =>''index'' > else > render :action => ''edit'' > end > end > > On my localhost everything works OK. > On the server when i enter text that includes .... > select.......from... in text_area i got previous error > ??? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Colin, thanks for interest to help :)
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
_______________________________
here is complete error message:
SQL (0.1ms) SET NAMES ''utf8''
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
Processing ApplicationController#index (for 78.1.161.36 at 2010-11-14
16:42:36) [GET]
Parameters: {"commit"=>"Update",
"_method"=>"put",
"authenticity_token"=>"em1SzD5Y64tt9E9B3C684ToovjDNK314CdxeGQys1Hg=",
"page"=>{"background_id"=>"161",
"title_fr"=>"La chambre de la
porterie", "title_de"=>"Zimmer im Portalbau",
"publish_flv"=>"0",
"b_color_id"=>"4",
"s_rotate_x"=>"0",
"publish_as_gallery"=>"0",
"s_rotate_y"=>"0", "short_en"=>"",
"publish_gallery"=>"0",
"d_rotate_x"=>"0",
"hide_title"=>"1",
"text_left"=>"0", "b_x"=>"0",
"d_rotate_y"=>"0", "b_y"=>"100",
"short_fr"=>"", "short_de"=>"",
"content_en"=>"When selecting the furnishings for the Chateau
we were
constantly struck and fascinated by the furniture and lighting designs
of famous architects. The wardrobe in this twin-bedded room is a prime
example of this formal, minimalist and ideally-proportioned designer
discourse. In addition to this wardrobe, Spencer Fung, a London-based
architect originally from Hong Kong, also designed the solid Dragon
bench in the Conference Room and the cabinets with sliding doors in
the dining room and lounge.\r\n",
"publish_text"=>"1",
"scale_flv"=>"", "x_swf"=>"",
"parent_id"=>"3", "y_swf"=>"",
"publish_swf"=>"0",
"content_fr"=>"Lorsque nous avons choisi les
objets pour décorer ce château, le mobilier et les luminaires
d’architectes de renom n’ont cessé de nous émouvoir et de nous
fasciner. \r\n\r\nDans cette chambre aux lits jumeaux, l’armoire
adhère à ce répertoire formel sobre, minimaliste et aux proportions
idéales. Spencer Fung, l’architecte londonien originaire de Hong Kong,
outre cette armoire, est représenté au château par le banc massif
Dragon dans la salle de conférence et les vitrines à portes
coulissantes dans la salle à manger et le salon.",
"content_de"=>"Beim
Auswählen der Einrichtungs- gegenstände für dieses Chateau haben uns
immer wieder die Entwürfe von namhaften Architekten für Möbel und
Lampen berührt und fasziniert. \r\n\r\nIn dieser klaren, reduzierten
und genial proportionierten Formensprache ist auch der Kleiderschrank
in diesem Schlafzimmer mit zwei getrennt nebeneinander stehenden
Betten. Spencer Fung, der Londoner Architekt aus Hongkong hat außer
diesem Kleiderschrank die schwere Sitzbank \"Dragon\" im Seminarraum
und die Schiebetür Vitrinen im Esszimmer und im Salon gezeichnet.\r
\n", "title_en"=>"Gatehouse Room"}}
ActionController::RoutingError (No route matches "/500.shtml" with
{:method=>:get}):
config/initializers/cgi_session_hack.rb:42:in `call''
Rendering rescues/layout (not_found)
On Nov 14, 9:59 am, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> On 13 November 2010 23:06, MoonFlash
<mladimi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
> >> 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
>
> > 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%>
> > _______________________________
> > PagesController:
> > def update
> > @page = Page.find(params[:id])
>
> > if @page.update_attributes(params[:page])
> > flash[:notice] = t(''flash.page_edited'')
> > redirect_to :action =>''index''
> > else
> > render :action => ''edit''
> > end
> > end
>
> > On my localhost everything works OK.
> > On the server when i enter text that includes ....
> > select.......from... in text_area i got previous error
> > ???
>
> > --
> > You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
> > To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
MoonFlash, I was wondering if you solved this. I am having the same problem and can''t figure it out. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.