execv
execv

Reputation: 849

Ruby: Display Attributes

I have the following in a view file:

<%= render :partial => "medium_deal", :collection => category_locales, :as => :deal_locale %>

In my partial template file, I want to print out all attributes for deal_locale. How can I do that? (Basically, a var_dump in PHP)

Upvotes: 0

Views: 75

Answers (1)

cailinanne
cailinanne

Reputation: 8372

I'm assuming this is just for debugging purposes? If so

<% logger.info "#{deal_locale.inspect}" %>

should do the trick.

Or, if you really want to see it in your browser, just

<%= "#{deal_locale.inspect}" %>

Upvotes: 1

Related Questions