Hello:
I have an RJS tied to periodic update in one of my controllers. I want
the output text to be stylized, so I have the code in the RJS wrapped
in custom style tags:
“<%=h q.text %>” by <%=h q.author %>, <%=h q.year
%>
For some reason, this style isn’t being applied with each periodic
update, although the HTML is definately being updated, as the data is
refreshing, nor is it changing when I change the style in the RJS. I
have also tried applying the style around the div that receives the HTML
injection from the RJS, but that’s not working either.
Here’s the style definition from my css:
LgTextWh {font-size:125%; font-weight: normal; color: white}
[NOTE: these are purposely not children of “body” as I needed more
flexibility in setting text standards.]
And the code around the periodic update in my view:
<%= image_tag "logo.gif" %> | <%= periodically_call_remote(:url => {:controller => tasks:action => 'quotes_panel'}, :frequency => 60) %> |
and the method that the periodic remote call uses:
def quotes_panel
@quote = Quote.find_by_sql(“SELECT * FROM quotes ORDER BY RAND()
LIMIT 1”)[0]
render :update do |page|
page[‘quote’].replace_html :partial => ‘quote_rand’, :locals => {
:q => @quote}
end
end
Thank you very much in advance for your help!
Mike