I want to display my controller variable on hover of a button . I tried " :title => @variablename " but it doesnt seem to work
<%= link_to 'Refresh',
'/dtr_refresh',
id: 'refresh_dtr_link',
class: 'btn btn-info',
:title => @last_refreshed_time,
remote: true %>
You need to define your instance variable (@last_refreshed_time) on your controller, here is an example
class HomeController < ApplicationController
def index
@last_refreshed_time = Time.now
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With