On 14 Jan 2009, at 03:50, David wrote:
>
> I'm using an html calendar builder and am getting a compile error when
> trying to input a close to some ruby code into the cell_input:
> cell_text << "%>", it seems that it is choking on the closing > sign.
> Is there any way to escape this?
>
> I could really use some help here, not sure how to search for
> information on this. Thanks.
> This is the line that I am having issues with:
>
> cell_text << "%>"
>
<% and %> are special in erb. You need to use <%% and %%> to include
literal <% and %>
Or avoid the whole lot by putting it in a helper.
Fred
> This is the error output:
>
> ActionView::TemplateError (compile error
> syntax error, unexpected $undefined, expecting kEND
> ...<< ").to_s); _erbout.concat "\"\n \n \n\n\n [cell_text,...
> ^
> syntax error, unexpected $end, expecting ')') on line #37 of users/
> _calendar_large_data.rhtml:
> 34:
> 35: cell_text << "<%= "
> 36: cell_text << "javascript_tag \"new Popup('test_popup...@day}',
> 'test_popup_link...@day}',{position:'25%,30%', trigger:'click',
> modal:true})\""
> 37: cell_text << "%>"
> 38:
> 39:
> 40:
>
> I was having a similar compile issue with inputting double quotes into
> the cell_text array and was able to use \ to avoid any problems:
>
> cell_text << "<div id=\"test_popup...@day}\" class=\"cal_popup\"
> style=
> \"display:none\">"
> >
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---