Hi,

sw0rdfish wrote:

> I've created some AJAX type searches in my project that rely
> on searching on companies, which I use the INDEX action of
> company_controller and pass a parameter

While 'index' is an OK choice here, given the default action in Rails, you
might want to consider using the 'list' method directly instead.  'index' is
the default action for any url.  What action that actually is a design
choice.

> Simple...  now where I'm confusing myself is that I use the index
> action to generate a list of companies several times... but the way I
> have ti setup, I'm foreced to render search_results each time...  I'm
> curious what you guys think the best way to get around this is...
>
> putting conditions in the RJS?
>
> if params[:flag] == red
>      page.replace_html 'results', :partial => '/
> search_results_no_widgets'
> else
>    page.replace_html 'results', :partial => '/
> search_lists_with_widgets'
> end

I would definitely recommend this to the other solution you're considering.
>From a 'personal preference' perspective, i'd assign params[:flag] to an
instance variable in the controller.  Better decoupling, IMHO.

HTH,
Bill


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to