I want to see if the values are making it over from my form into my controller. What''s the way to test that ? TIA Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I want to see if the values are making it over from my form into my > controller. > What''s the way to test that ? > > TIA > Stuart > > --You could always use a params.inspect or params.to_yaml to see what''s in it. Do you have fire bug for mozilla? This will show you request and response, and also allow you to search through the dom. It''s pretty sweet. https://addons.mozilla.org/firefox/1843/ Hope that helps --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/12/06, Daniel N <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I want to see if the values are making it over from my form into my > > controller. > > What''s the way to test that ? > > > > TIA > > Stuart > > > > -- > > > You could always use a params.inspect or params.to_yaml to see what''s in > it. > > Do you have fire bug for mozilla? This will show you request and > response, and also allow you to search through the dom. It''s pretty sweet. > > https://addons.mozilla.org/firefox/1843/ > > Hope that helpsI have firebug. Probably I need to learn how to use it. Stuart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/12/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 10/12/06, Daniel N <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > On 10/12/06, Dark Ambient < sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > I want to see if the values are making it over from my form into my > > > controller. > > > What''s the way to test that ? > > > > > > TIA > > > Stuart > > > > > > -- > > > > > > You could always use a params.inspect or params.to_yaml to see what''s in > > it. > > > > Do you have fire bug for mozilla? This will show you request and > > response, and also allow you to search through the dom. It''s pretty sweet. > > > > https://addons.mozilla.org/firefox/1843/ > > > > Hope that helps > > > > I have firebug. Probably I need to learn how to use it. > > Stuart > > Sorry, because I''m not quite sure how to use the inject in this case. Myform is ajaxed, (set up with using observe_form), the controller / action is where the values should be showing up. What I can''t figure out is how to see if anything is showing up in the controller ? Not sure if this makes sense Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Stuart Fellowes wrote:>> Sorry, because I''m not quite sure how to use the inject in this case. My > form is ajaxed, (set up with using observe_form), the controller / > action is > where the values should be showing up. What I can''t figure out is how > to > see if anything is showing up in the controller ?Personally, I use three different techniques. These all work well, it just depends on the situation. 1) Add the following line to the RJS template for the action (or, if you aren''t using RJS templates, create a temporary one for the action you want to watch, just for testing purposes, containing only this line): page.alert params.inspect This will give you your params hash in a pop-up JavaScript window in your browser. 2) You ARE using ''tail -f log/development.log'' every time you run ''script/server'', right? If not, you are making development twice as difficult as it needs to be, and missing out on a ton of information Rails gives you about your application as it runs. One of those pieces of information is the params hash. It gets logged every time an action is triggered. BUT, there''s so much other information scrolling by, it''s easy to miss! What can be done? Easy: open another terminal window and run: ''tail -f log/development.log | grep Parameters''. Now every time an action is triggered and the params hash gets logged, that''s all you''ll see. 3) Install firebug and learn how to use it ;) Admittedly, this only shows what data is being sent to the application, not what your application''s action is actually receiving, so it won''t help fix bugs where (for example) you''re accidentally sending the request to the wrong URL, but on the other hand, it shows both the request and the response, which can be very useful. Hope this helps! - Chris -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 10/12/06, Chris Gernon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Stuart Fellowes wrote: > >> Sorry, because I''m not quite sure how to use the inject in this > case. My > > form is ajaxed, (set up with using observe_form), the controller / > > action is > > where the values should be showing up. What I can''t figure out is how > > to > > see if anything is showing up in the controller ? > > Personally, I use three different techniques. These all work well, it > just depends on the situation. > > 1) Add the following line to the RJS template for the action (or, if you > aren''t using RJS templates, create a temporary one for the action you > want to watch, just for testing purposes, containing only this line): > > page.alert params.inspect > > This will give you your params hash in a pop-up JavaScript window in > your browser.This is a good thing to know ..appreciate it ! 2) You ARE using ''tail -f log/development.log'' every time you run> ''script/server'', right? If not, you are making development twice as > difficult as it needs to be, and missing out on a ton of information > Rails gives you about your application as it runs. > > One of those pieces of information is the params hash. It gets logged > every time an action is triggered. BUT, there''s so much other > information scrolling by, it''s easy to miss! What can be done? > > Easy: open another terminal window and run: ''tail -f log/development.log > | grep Parameters''. Now every time an action is triggered and the params > hash gets logged, that''s all you''ll see.Right - since I''ve actually fixed a few more things I''m noticing the params coming through (I think) - Processing AjaxsearchController#list (for 127.0.0.1 at 2006-10-12 11:05:16) [POS T] Session ID: ea2c016d29ba637d81895fabc3a2f692 Parameters: {"asearch"=>"position[category_id][]=1", "action"=>"list", "controller"=>"ajaxsearch", "position"=>{"city"=>"New York", "title"=>"", "state_id"=>[ "2"]}} I guess though it doesn''t look like my find code is getting updated. In a PP printout it looks like the find conditions are loading once with the default values of the form (when it first loads) 3) Install firebug and learn how to use it ;) Admittedly, this only> shows what data is being sent to the application, not what your > application''s action is actually receiving, so it won''t help fix bugs > where (for example) you''re accidentally sending the request to the wrong > URL, but on the other hand, it shows both the request and the response, > which can be very useful.Well it''s good for something and I was able to track down a few problems with it. Stuart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---