Re: Styling rails elements

Frederick Cheung
Wed, 07 Jan 2009 00:33:58 -0000

On 6 Jan 2009, at 20:54, Ryan Ororie wrote:

>
> I''m having some trouble with styling my views.
>
> Here is a particular snippet that I think illustrates well:
>
> <%= @tour_request.booked_datetime ?
"Confirmed For:</
> strong>
> <span
class="red">#{@tour_request.booked_datetime_string}
> ":"Date and time requested:
> #{@tour_request.daterequested} | #{@tour_request.preferredtime_string}
> Alternative date and time requested:
> #{@tour_request.altdaterequested}
> #{@tour_request.preferredtime_string}"
> %>
>
> That will prevent the page from loading, showing a custom error
> screen.

At a basic level that code boils down to

"blahblahblah"red"blabblahblah"

which isn''t syntactically correct (quotes in strings need to be
escaped)

Fred


>
>
> But this, will display fine:
>
> <%= @tour_request.booked_datetime ?
"Confirmed For:</
> strong>
> #{@tour_request.booked_datetime_string}
> ":"Date
> and time requested: #{@tour_request.daterequested} |
> #{@tour_request.preferredtime_string} Alternative date and
> time
> requested: #{@tour_request.altdaterequested}
> #{@tour_request.preferredtime_string}" %>
>
> The only difference is on the first example I had <span
>
class="red">#{@tour_request.booked_datetime_string}
and the
> second I had
#{@tour_request.booked_datetime_string}
>
> I know I could just do <%>
@tour_request.booked_datetime_string %> but this field won''t always
be
> displaying, so I need to find a way to make whichever that particular
> tour has filled out showing, whether it''s booked_datetime_string,
> tour_request.daterequested, preferredtime_string or altdaterequested
>
> Would appreciate any help!
> --
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org