Hobo / hobo

The web app builder for Rails (moved from tablatom/hobo)

Home Page:http://hobocentral.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Field labels from associations cannot be overridden

enwood opened this issue · comments

In a Hobo 2.1.0 project, I have a User model. A user can have many projects.

On a Project#Show page, Hobo completely ignores that tag directive on fields being displayed via associations:

 <content-body:>
   <feckless-fieldset class="horizontal" 
      fields="name, user, user.id">
     <user-id-label:>
       My User ID
     </user-id-label:>
    </feckless-fieldset>
  </content-body:>

In the screen shot, the id label is not overridden.

screen

Ignacio has confirmed that Using "user.id" makes the params unusable inside a field list, and proposed these work-arounds:

  • Use "user_id" and then "user-id-label" as param.
  • Add a virtual attribute in your project model. For example, if you want to access the user email in that field list:
def user_email
  user.email_address
end

This will allow you to use "user_email" as a project field in the show page.