Thanks for your help, I think it's getting closer, but I am recieving
a No Method Error,

I have defined the named_scope, as you suggested (I beleived this
needs to be housed in the Model?)


named_scope :finished_versions, { :joins => :status, :conditions =>
{ :statuses => { :name => 'Certified' }}, :order =>
'versions.created_at DESC' }



and have updated the method within the controller to read exactly as
suggested:


@version.finished_versions.apply_scopes(:search =>
[params[:search], :version])


I am just getting returned :- undefined method `finished_versions' for
nil:NilClass


On May 19, 6:07 pm, kevinpfromnm <[email protected]> wrote:
> First, would take your filter there and put it in a named scope.
>
>   named_scope finished_versions, { :joins => :status, :conditions =>
> { :statuses => { :name => 'Finished' }}, :order =>
> 'versions.created_at }
>
> then just need
>
>   @version.finished_versions.apply_scopes( :search => ...
>
> On May 19, 2:38 am, Pete <[email protected]> wrote:
>
>
>
>
>
> > I have a <table-plus> defined on a separate page, with conditions
> > applied within, i.e. My controller contains:
>
> > @version = Version.find(:all, :joins => :status, :conditions =>
> > { :statuses => {:name => 'Finished'}}, :order => 'versions.created_at
> > DESC', :limit => 50)
>
> > and the dryml code -
>
> > <table-plus with="&@version" fields="application, application.owner,
> > created_at" without-search-form>
> > <empty-message:>There are no applications</empty-message:>
>
> > </table-plus>
>
> > This works fine as is.........
>
> > I need the :conditions to be applied, but I also want to be able to
> > search the table - sorting is not soo important, but I really want to
> > implement the Search function, but do not know how to implement
> > apply_scopes in this context, and cannot find any combined examples
> > such as this?
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Hobo Users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/hobousers?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/hobousers?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to