How can I add line breaks into my event title in json
one thing i can not get straight is the ability to add html without it being escaped or actually creating new lines
he开发者_开发技巧re's my json:
{ "id": 30,
"title": "Basics \n Awesome Abs & Butt Blast \n Danielle B",
"start": "2010-05-11T08:00:00-04:00",
"end": "2010-05-11T08:30:00-04:00",
"allDay": false
}
and here's the code for it:
[
<% @events.each do |e| %>
{ "id": <%= e.id -%>,
"title": "<p><%= e.event_template.level %></p><p><%= e.monqi_class.title %></p><p><%= e.instructor.last_initial %></p>",
"start": "<%= e.start_date.iso8601 %>",
"end": "<%= e.end_date.iso8601 %>",
"allDay": false
}
<%= @events.last == e ? "" : "," %>
<% end -%>
]
so I am trying to have inside an even 3 lines, (level, class title, and instructor)
the problem is it's getting escaped so the charcters are not being parsed by html
can you please help me with that?
Thanks a lot
Ami
Use a token for a line-break, like ~
or |
, then replace it with <br />
on the output.
discussion on the issue tracker regarding this topic. might help: http://code.google.com/p/fullcalendar/issues/detail?id=351
精彩评论