Я пытаюсь создать гиперссылку на странице индекса, но она не отображается, и она также не дает никаких ошибок. Вот мой код index.html.erb.link_to не отображает ничего рельсов
<h1> Listing articles </h1>
<% link_to 'New article', new_article_path %> <---- Everything works perfectly except this doesnt show anything
<table>
<tr>
<th>Title</th>
<th>Textssss</th>
<tr>
<% @articles.each do |article| %>
<tr>
<td><%= article.title %> </td>
<td><%= article.text %> </td>
</tr>
<% end %>
</table>
Я проверил свои маршруты, и я думаю, что они тоже в порядке.
Prefix Verb URI Pattern Controller#Action
welcome_index GET /welcome/index(.:format) welcome#index
articles GET /articles(.:format) articles#index
POST /articles(.:format) articles#create
new_article GET /articles/new(.:format) articles#new
edit_article GET /articles/:id/edit(.:format) articles#edit
article GET /articles/:id(.:format) articles#show
PATCH /articles/:id(.:format) articles#update
PUT /articles/:id(.:format) articles#update
DELETE /articles/:id(.:format) articles#destroy
root GET / welcome#index
Я могу вручную получить доступ к статье/новому из локального хоста, но я не думаю, что проблема. Любая помощь приветствуется.
добавить '=' в 'link_to'. '<% = link_to 'Новая статья', new_article_path%>' и читаем о ['ERB'] (http://stackoverflow.com/questions/3952403/without-equal-in-ruby-erb-means) –
Спасибо, чувак что прояснилось много вещей .. – soldiershin