On 1/5/2011 9:05 AM, Arun Kumar wrote:
> Hi All,
>
>   I will be happy if someone clear doubt, i can see objects in view by
> using<%= debug @object %>  and lot of methods is there apart from view
> like
> .to_yml, etc
>
> Is there any method available for seeing the converted sql from
> ActiveRecord method in view, etc. Although I can find it in console but
> it will confuse when we run multiple queries..
>
> example:
>
>   User.find :all
>
> it will produce
>
> "SELECT * FROM users;"
>
> in output console
>
> But i want it in view are any other specific point like yml , etc ?
This is really a Rails question and should go on the Rails list.  That 
said, the console just prints the the results from .inspect on whatever 
was returned by the last statement, so you should just be able to use 
User.find(:all).inspect.