hi i got to merge a hash of parameters for every action for every controller. the only thing i could image is modifying a super class method. so, how could i modify the method that take care of setting up the parameters? is it ActionController.parameters? -- 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 25 May 2010 15:40, vladimirprieto <vladimirprieto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi > > i got to merge a hash of parameters for every action for every > controller. the only thing i could image is modifying a super class > method.No doubt I am showing my ignorance (as usual), but could you explain in more detail what you are trying to do? Colin> > so, how could i modify the method that take care of setting up the > parameters? is it ActionController.parameters? > > -- > 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.
On 25 mayo, 11:11, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 25 May 2010 15:40, vladimirprieto <vladimirpri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > i got to merge a hash of parameters for every action for every > > controller. the only thing i could image is modifying a super class > > method. > > No doubt I am showing my ignorance (as usual),well, at least we are 2! ;)> but could you explain in more detail what you are trying to do?is difficult to explain, but i''ll try: on simple words: a search form, with some inputs (search value, search operator, search order an so on) the problem: on every search, results can be edited, or if the users wants to, create a new one (after a search), or just show a record (CRUD). but, after any CRUD action, it must go back to the orginal search made. multiply this behaviour to all controllers. so, i could (in fact i did) pass every single search input like hidden inputs in order not lose those values between actions and views for everycontroller. but i want something more clean and more "automaticly". this will take more relevance, as i c controllers will be more and more through time. hope is more clear now. thanks. -- 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.
Vladimir Prieto wrote:> i got to merge a hash of parameters for every action for every > controller. the only thing i could image is modifying a super class > method. > > so, how could i modify the method that take care of setting up the > parameters? is it ActionController.parameters?I can''t imagine why you would need to do something like this, but it seems likely you could do what you want with a piece of custom Rack middleware: http://guides.rails.info/rails_on_rack.html#action-controller-middleware-stack You could probably insert your middleware somewhere after the ActionController::ParamsParser internal middleware. -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 May 2010 16:27, vladimirprieto <vladimirprieto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 25 mayo, 11:11, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> On 25 May 2010 15:40, vladimirprieto <vladimirpri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > i got to merge a hash of parameters for every action for every >> > controller. the only thing i could image is modifying a super class >> > method. >> >> No doubt I am showing my ignorance (as usual), > > well, at least we are 2! ;) > >> but could you explain in more detail what you are trying to do? > > is difficult to explain, but i''ll try: > > on simple words: a search form, with some inputs (search value, search > operator, search order an so on) > > the problem: on every search, results can be edited, or if the users > wants to, create a new one (after a search), or just show a record (> CRUD). but, after any CRUD action, it must go back to the orginal > search made. multiply this behaviour to all controllers. > > so, i could (in fact i did) pass every single search input like hidden > inputs in order not lose those values between actions and views for > everycontroller. but i want something more clean and more > "automaticly". this will take more relevance, as i c controllers will > be more and more through time. > > hope is more clear now.Would an alternative be to store the information in the session? Then you would not have to keep passing it to the controllers. 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.
On 25 May 2010 16:27, vladimirprieto <vladimirprieto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the problem: on every search, results can be edited, or if the users > wants to, create a new one (after a search), or just show a record (> CRUD). but, after any CRUD action, it must go back to the orginal > search made. multiply this behaviour to all controllers.I think your solution is a little ''clunky''; as you''re discovering - if something''s hard to do, there''s probably an easier way. Would it work for you to store the search criteria in the session? Any controller action can access this, and if there are some actions that accept the user posting changes to the search, then that action can merge the changes into the session-stored value. -- 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.
On 25 mayo, 11:29, Robert Walker <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I can''t imagine why you would need to do something like thisimagine this: - too much records to search for. - after a few searches, user finally get a group of records (not only one) to work on. - user edits one ...save it and he has to search again to get the same group? no way! users are lazy. instead, why don''t show him the same group of records that he search before? that way, user can edit the next over and over again without searching everytime. so, how can i get the same group of searched records? searching again. am i right?>, but it > seems likely you could do what you want with a piece of custom Rack > middleware: > > http://guides.rails.info/rails_on_rack.html#action-controller-middlew... > > You could probably insert your middleware somewhere after the > ActionController::ParamsParser internal middleware.i''ll give a read! thanks! -- 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 25 mayo, 11:33, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Would it work for you to store the search criteria in the session?didn''t thought that. i''ll play with it and see where i go. thanks too. -- 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.
Vladimir Prieto wrote:> On 25 mayo, 11:29, Robert Walker <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I can''t imagine why you would need to do something like this > > imagine this: > > - too much records to search for. > - after a few searches, user finally get a group of records (not only > one) to work on. > - user edits one > > ...save it and he has to search again to get the same group? no way! > users are lazy. instead, why don''t show him the same group of records > that he search before? that way, user can edit the next over and over > again without searching everytime. > > so, how can i get the same group of searched records? searching > again. am i right?If I were to implement this I would create a new model, something like Search or SavedSearch, and use the database to store recent searches. Someone also mentioned that you could store the search criteria in the session, which would work fine, as long as you only need to store one set of search criteria per user. Storing the search criteria in it''s own table adds more flexibility to the system. This way you could allow the users to essentially "bookmark" their searches. Since you would have this separate Search model you could provide views for users to organize and manage their searches. -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.