In the end, what solved my naming problem was using the following:
<%= link_to "#{course.order_taught} #{course.type_name} #
{course.name}", {:action => 'show', :id => course } %>
I had to take some time to go back and review some of the basics of
Ruby, and in the end, the solution was really simple.
Thanks again for your help!!
On Nov 18, 7:16 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Nov 18, 2:07 pm, Demetrius <demetri...@hotmail.com> wrote:
>
> > Hello! I'm looking for assistance EXTENDING an example from the Agile
> > Web Development With Rails book:ComposingDatawith Aggregation (page
> > 324).
>
> > I'm trying to mapthreecolumns to a single Ruby object. However,
> > unlike the example in the Agile Web Development book, thethree
> > columns I want to map into one object come fromTHREEDIFFERENT
> >models.
>
> Composed_of is not normally used (or probably designed to be used) in
> this way). The basic idea is that you have some raw attributes and you
> turn them into a object, for example you might have attributes on your
> model called start and finish and use composed_of to create a magic
> attribute called Range whose endpoints are those attributes.
>
> If you want your standard object to have the name from the Grade
> object, could you just do
>
> def grade_abbr
> grade.grade_abbr
> end
>
> (and when you're happy with this, have a look at delegate)
>
> Fred
>
> > I want to map the followingthreecolumns into one object:
> > grade.grade_abbr, strand.strand_abbr, standard.number (ex. 5 NS 2.3).
> > Also, I only need to read the new object--not edit the original
> > columns.
>
> > Here are themodelsand their relationships: