我对rails非常陌生,我想知道如何将控制器中的变量显示到我的视图中.
基本上,我有2个文件:articles_controller.rb和_article.html.erb
articles_controller.rb
_article.html.erb
在我的控制器文件中,我有一个@article_votes我想在视图中显示的变量.我尝试过使用<%= @article_votes %>但它根本不显示任何内容.
@article_votes
<%= @article_votes %>
有人会有任何指导吗?谢谢!
variables controller ruby-on-rails view
controller ×1
ruby-on-rails ×1
variables ×1
view ×1