ruby on rails - How are instance variables used? -


Say in a controller for comments, I have

  def to make @comment = Comment For example, in my questions: How can i get  @comment   

Controller under the show, I have a form_for link for comment, can I use comment there? Or can I make it for comment on only one page?

It does not make any sense, ask "in what thoughts" there is only one view, which The given view is this app / view / & lt; Admin name & gt; is the default for matching the action name.

You can not access it in another view provided by another verb, to set this action provided by the to set @comment for must perform this action.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -