0
- if signed_in?
  = primary_nav(                                                                                                              |
    title: { text: t('.home_page'), href: root_path },                                                                |
    links: [                                                                                                                  |
      { active: request.path.starts_with?('/performance/'), text: t('.performance'), href: performance_my_path },   |
    ]                                                                                                                         |
  ) do 

I am trying to undersntad this code, this is in Rails and this is in application.html.haml My main confusion is where we have those keywords like title, links, active, text What language is it? It isn't Rails? is it ? Or is it Twitter Bootstrap? So If I want to add another link on the same level as performance, I should just add another hash?

4

1 回答 1

1

primary_nav是在您的应用程序某处定义的方法,可能在某个帮助程序中。此方法将哈希作为参数,'title' 和 'links' 是此哈希的键。primary_nav您应该在您的应用程序中找到 的定义。它与 twitter-bootstrap 没有任何关系。

于 2013-06-17T14:29:19.903 回答