user1560922
user1560922

Reputation: 267

Ruby on rails - #<Resource:0x007f1004593600> weird message

I don't know why I get some weird message on my view when I try to assign a variable.

<%= column = local_assigns[:param] %>

This is what I get on my view:

#<Resource:0x007f1004593600> 

#<Resource:0x007f1004592e08> 

#<Resource:0x007f1004889eb8> 

Upvotes: 0

Views: 43

Answers (1)

Incommunicado
Incommunicado

Reputation: 31

Change the code to the following

<% column = local_assigns[:param] %>

and you should not get the error message. I've basically removed the "=" symbol after the first <%. The "="symbol implies that the value of "column" will be printed to the screen.

Without the "=" symbol, the code executes without printing any output.

Upvotes: 3

Related Questions