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.

your use of link_to , html_safe looks me.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -