Thanks to both!

In the server.rb, I created a named_scope (scope for Rails 3) like:
scope :sname_like, lambda { |q| where('servers.name LIKE ?', "%"+q
+"%")}
There's probably a better way to write the %q% above, but it worked.

And in the dc_locs_controller.rb:
def edit
  @SList = Server.sname_like find_instance.apc.name
  hobo_show
end

Together, it's now working!

many props to http://m.onkey.org/active-record-query-interface
and http://rubyreflector.com/Skinny
for discussions on scope.

Regards,
M

On Jun 7, 11:30 am, Tomoaki Hayasaka <[email protected]>
wrote:
> Probably I don't fully understand your requirement, but,
>
>   def edit
>     @SList = Server.name_contains(find_instance.apc.name)
>     hobo_show
>   end
>
> -----
> Tomoaki Hayasaka <[email protected]>

-- 
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