2016-12-02 4 views
0

meine index.html.haml Seiten:link_to article.node.nodeName, topics_path (Knoten) auftreten http: // localhost: 3000/topics.8

.panel-heading 
    %p.panel-title article 
    .panel-body.row 
    - @article.each do |article| 
     %h5.col-md-6.clearfix 
     = link_to article.title, article, style: "color: black"; 
      %span.badge.pull-right 
      = article.comments.count 
     .info.text-muted 
     = link_to article.node.nodeName, topics_path(article.node.id) 
     • 
     = article.comments.last.created_at 

Routen:

  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 
       topics GET /topics(.:format)         topics#index 
       topic GET /topics/:id(.:format)        topics#show 
       sites GET /sites(.:format)         sites#index 
       jobs GET /jobs(.:format)         jobs#index 
       notes GET /notes(.:format)         notes#index 
        POST /notes(.:format)         notes#create 
      new_note GET /notes/new(.:format)        notes#new 
      edit_note GET /notes/:id/edit(.:format)       notes#edit 
       note GET /notes/:id(.:format)        notes#show 
        PATCH /notes/:id(.:format)        notes#update 
        PUT /notes/:id(.:format)        notes#update 
        DELETE /notes/:id(.:format)        notes#destroy 
       root GET /            articles#index 

db Article und Node Verein haben builded:

Article(id: integer, title: string, text: text, 
created_at: datetime, updated_at: datetime, user_id: integer, node_id: 
integer,article_img_file_name: string, article_img_content_type: 
string, article_img_file_size: integer, article_img_updated_at: datetime) 

Node(id: integer, nodeName: string, created_at: datetime, 
updated_at: datetime) 

the question is:

i war klicken Sie auf die a Tag Diesen:

http://localhost:3000/topics.8 

  1. = link_to article.node.nodeName, topics_path(article.node)

    versucht haben, aber keinen Sinn

    i thonght kann link_to Syntax falsch machen

Was ist das Problem? wie kann ich es lösen? dank

Antwort

0

Es topic_path statt topics_path

= link_to article.node.nodeName, topic_path(article.node) 

prüfen diese Route sollte

topic GET /topics/:id(.:format) topics#show 
Verwandte Themen