Monday, 2 September 2013

rails how to declare a variable and store a value in html.erb

rails how to declare a variable and store a value in html.erb

hi i have a value like this in html.erb
<img src="<%= file.title, file_path(file) %>" alt=""/>
but when I placed the above code it throws an error
SyntaxError in Files#index
the error comes on file_path(file) section . Is there a way to accomplish
this ? like declare a variable and assign it to something ?

No comments:

Post a Comment