Ruby on Rails 3 — looking for the iterator and accessors model


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
16 views
The issue in the context of Ruby on Rails 3.0.3.

Given: a model (aka essence, aka table) with 30+ fields (aka attributes, accessors). there are scaffoldings view (link to source) in which plain text is displayed name and field value. The trouble is that here in the view fixed the field names. I wish it was variable as connected to the module localization.

Required: record is not in plain text all 30+ fields in HTML and pass through all model attributes and for each attribute to take the i18n-name (Lastname or Surname). Well, withdraw.

@request.to_a.each does not help, because the type attribute lastname is like accessors, that is, methods (?).

Maybe somewhere I misunderstood something, please explain.

https://gist.github.com/713493
by | 16 views

1 Answer

0 like 0 dislike
Happened:
\r
\r
\r<% @request.attributes.each do |a,b| %> \r<%=t "activerecord.attributes.request.#{a}" %>:<%=h b %>\r<% end %> 
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
28,075 users