the LIST command isn't part of the 7 REST actions... so using list, is
un-restful!

I'm still not convinced that the if statment in the RJS file is the
way to go.... for fun I made a new RJS file, called it index.js2.rjs
and made a new MIME type in environment.rb and it seems to work
well... I've got to maintain two RJS files, but to me it makes sense
because they're rendering two different views using two different
partials... the only thing that is the same is the controller action
that fetches the company...

doing the If in the RJS kinda fells as dirty as putting an IF in the
view....

On Oct 30, 4:02 pm, "Bill Walton" <[EMAIL PROTECTED]> wrote:
> 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