On Jueves, 6 de Mayo de 2010 11:10:34 KHelal escribió: > Or even better, just define that a constant in the init.rb file and > then use that in the views. That way you only have to do the check > once.
Puttint it in init probably won't work, because ActiveScaffold can be loaded before XSS plugin. Also, we would have to add multiple if statements which I would prefer to avoid. Maybe we can define html_safe! as an empty method and use that method, and when XSS plugin is loaded will override our method. If someone send a patch like that I will commit it. > > On May 6, 1:06 pm, KHelal <[email protected]> wrote: > > Hmm I understand what you mean. Problem tho is that for the ones which > > have enabled XSS protection, we're screwed since we can't really use > > AS that much. > > > > One way to detect whether XSS protection is activated would be to do a > > respond_to? call such as this: > > > > def xss_present? > > 'test'.respond_to?(:html_safe!) > > end > > > > This would return TRUE if html_safe! can be called (and thus the > > plugin is activated) and FALSE otherwise. > > > > What do u think? > > > > On May 6, 12:34 pm, "Sergio Cambra .:: entreCables S.L. ::." > > > > <[email protected]> wrote: > > > On Miércoles, 5 de Mayo de 2010 19:06:52 KHelal escribió: > > > > Hi, > > > > > > > > When using the latest stable version of Active Scaffold for rails > > > > 2.3, the pagination links are not properly marked as html_safe!, thus > > > > causing the whole html string to appear at the botton of each page: > > > > > > > > Previous <a href="/admin/users?page=1" > > > > onclick="addActiveScaffoldPageToHistory('/admin/users?page=1', > > > > 'as_admin__users');; new Ajax.Request('/admin/users?page=1', > > > > {asynchronous:true, evalScripts:true, method:'get', > > > > onComplete:function(request){$('as_admin__users-pagination-loading- > > > > indicator').style.visibility = 'hidden';}, > > > > onFailure:function(request) > > > > {ActiveScaffold.report_500_response('as_admin__users-active- > > > > scaffold')}, parameters:'authenticity_token=' + > > > > encodeURIComponent('NMPQi8+qaPpAOR6D9sC9Vpq5d0NR0F5gscbF5t8A8zM=')}); > > > > $ ('as_admin__users-pagination-loading-indicator').style.visibility = > > > > 'visible';; return false;">1</a> 2 > > > > > > > > Can you please fix it? > > > > > > html_safe! is a rails3 feature, and AS only support rails 2.3 in this > > > moment. I know there is a plugin which adds html_safe! to rails 2.3, > > > but I don't want to force use of that plugin. I will accept patches > > > with html_safe! support if it doesn't force to install the plugin. > > > > > > -- > > > Sergio Cambra .:: entreCables S.L. ::. > > > Mariana Pineda 23, 50.018 Zaragoza > > > T) 902 021 404 F) 976 52 98 07 E) [email protected] > > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "ActiveScaffold : Ruby on Rails plugin" 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 athttp://groups.google.com/group/activescaffold?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > > "ActiveScaffold : Ruby on Rails plugin" 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 > > athttp://groups.google.com/group/activescaffold?hl=en. -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.
