Ruby on Rails & FullCalendar: Is there any way to add a link to the title header? -
i have page in simple application displays calendar jquery plugin http://fullcalendar.io/.
i want add link title such user gets navigated somewhere else different view. possible? calendar has poor documentation. want add fontawesome icon , have redirect user on click.
i know customizing title pretty easy – specify custom title this:
<div id="calendar"></div> <script> $('#calendar').fullcalendar({ header: { left: 'prevyear,nextyear', center: 'title', }, titleformat: '[hello, world!]' }); </script>
however, trying add link next calendar using rails helper link_to
. possible? here attempt, not work:
<div id="calendar"></div> <script> $('#calendar').fullcalendar({ header: { left: 'prevyear,nextyear', center: 'title', }, titleformat: '[<%= link_to '<i class="fa fa-icon"></i>'.html_safe, some_path %>']' }); </script>
you have typo on line:
titleformat: '[<%= link_to '<i class="fa fa-icon"></i>'.html_safe, some_path %>']'
there single quote after %>
. try this:
titleformat: '[<%= link_to '<i class="fa fa-icon"></i>'.html_safe, some_path %>]'
if still have problem after fixing that, try looking fullcalendar’s titleformat
property supports. don’t know if fullcalendar tries allow put arbitrary html property – that property’s docs don’t make clear. check looking in rest of fullcalendar’s documentation or source code handles property.
Comments
Post a Comment