On Martes, 21 de Septiembre de 2010 17:18:15 Andrey Voronkov escribió:
> <div class="record-select" id="record-select-dept_head_groups">
>
> <form action="/dept_head/groups/browse?page=1&amp;update=1"
> id="record-select-dept_head_groups-search" method="post" onsubmit="new
> Ajax.Request('/dept_head/groups/browse?page=1&amp;update=1',
> {asynchronous:true, evalScripts:true, method:'get',
> parameters:Form.serialize(this)}); return false;"><div
> style="margin:0;padding:0;display:inline"><input
> name="authenticity_token" type="hidden"
> value="/LDtKCHL2hZaVdTHbM+B85FUmPAK8fbTy5YyG4cv9E8=" /></div>  <input
> autocomplete="off" class="text-input" id="search" name="search"
> type="text" />
> </form>
> <script type="text/javascript">
> //<![CDATA[
> var i =
> $(&quot;record-select-dept_head_groups-search&quot;).down('input.text-input
>'); Form.Element.AfterActivity(i, function() {
>   $(&quot;record-select-dept_head_groups-search&quot;).onsubmit();
> }, 0.35);
> //]]>
> </script>
>
> now all is clear - rails_xss escapes quotes around
> record-select-dept_head_groups-search
>
> What is the best way to fix this?

Try adding .html_safe after record_select_search_id.to_json, in 
_search.html.erb:

<%= record_select_search_id.to_json.html_safe %>

There are two lines to fix

>
> 2010/9/22 Andrey Voronkov <[email protected]>:
> > not exactly firebug but google chrome developer console (embedded in
> > browser). What is the tool to look on responses?
> >
> > 2010/9/22 Sergio Cambra .:: entreCables S.L. ::. <[email protected]>:
> >> On Martes, 21 de Septiembre de 2010 15:49:52 Andrey Voronkov escribió:
> >>> <input autocomplete="off" class="text-input"
> >>> id="record_group_709ba726e4aa99ebf6b471a681a88cc3_jets_1285076868723"
> >>> name="" onblur="this.focused=false" onfocus="this.focused=true"
> >>> type="text">
> >>>
> >>> that's all.
> >>>
> >>> I'm using rails 2.3.8 with rails_xss plugin. Can this cause the
> >>> problem?
> >>
> >> Are you looking html with firebug? I can't see script in html tab of
> >> firebug, I have to look at response. You must be getting the script,
> >> because you won't get any browse request in other case.
> >>
> >> wrong next link must be due to rails_xss plugin, maybe I have to add
> >> some html_safe calls.
> >>
> >>> 2010/9/21 Sergio Cambra .:: entreCables S.L. ::. 
<[email protected]>:
> >>> > On Martes, 21 de Septiembre de 2010 15:08:19 Andrey Voronkov escribió:
> >>> >> In the beginning I've noticed that when :record_select field gains
> >>> >> focus, this action is processed:
> >>> >>
> >>> >> Processing DeptHead::GroupsController#browse (for 127.0.0.1 at
> >>> >> 2010-09-21 23:03:23) [GET]
> >>> >>   DeptHead Load (3.1ms)   SELECT * FROM "users" WHERE ("users"."id"
> >>> >> = 4) AND ( ("users"."type" = 'DeptHead' ) ) LIMIT 1
> >>> >>   SQL (1.9ms)   SELECT count(*) AS count_all FROM "groups"
> >>> >> Rendered record_select/_search (10.3ms)
> >>> >>   Group Load (3.1ms)   SELECT * FROM "groups" ORDER BY id ASC LIMIT
> >>> >> 10 OFFSET 0 Rendered record_select/_list (65.5ms)
> >>> >> Rendered record_select/_browse (79.5ms)
> >>> >> Completed in 149ms (View: 108, DB: 16) | 200 OK
> >>> >> [http://localhost/dept_head/groups/browse]
> >>> >>
> >>> >> I'm guessing that search should appear through this method call but
> >>> >> with :search parameter. But there is no new requests on adding chars
> >>> >> to field.
> >>> >
> >>> > Yes you should get browse requests with search parameter. What is the
> >>> > code for that field? It should be like this:
> >>> > <input autocomplete="off" class="text-input" id="record_user"
> >>> > name="record[user]" onblur="this.focused=false"
> >>> > onfocus="this.focused=true" type="text" /><script
> >>> > type="text/javascript"> //<![CDATA[
> >>> > new RecordSelect.Single("record_user", "/admin/users/browse", {id:
> >>> > "", label: "", onchange: ""});
> >>> > //]]>
> >>> > </script>
> >>> >
> >>> >> 2010/9/21 Andrey Voronkov <[email protected]>:
> >>> >> > my controllers:
> >>> >> >
> >>> >> > class DeptHead::GroupsController < DeptHead::BaseController
> >>> >> >  record_select :search_on => :name, :model => :group
> >>> >> >  active_scaffold do |config|
> >>> >> >    config.columns = [:name, :forming_year, :course]
> >>> >> >    config.create.columns.exclude :course
> >>> >> >    config.update.columns.exclude :course
> >>> >> >  end
> >>> >> > end
> >>> >> >
> >>> >> > class DeptHead::JetsController < DeptHead::BaseController
> >>> >> >  active_scaffold do |config|
> >>> >> >    config.columns = [:group]
> >>> >> >    config.columns[:group].form_ui = :record_select
> >>> >> >  end
> >>> >> > end
> >>> >> >
> >>> >> > class DeptHead::ChargeCardsController < DeptHead::BaseController
> >>> >> >  active_scaffold do |config|
> >>> >> >    config.columns = [:teaching_place, :jets, :discipline,
> >>> >> >
> >>> >> > :lesson_type, :hours_quantity, :groups]
> >>> >> >
> >>> >> >    config.create.columns.exclude :groups
> >>> >> >    config.update.columns.exclude :groups
> >>> >> >    config.list.columns.exclude :jets
> >>> >> >    config.show.columns.exclude :jets
> >>> >> >    config.columns[:discipline].form_ui = :select
> >>> >> >    config.columns[:lesson_type].form_ui = :select
> >>> >> >    config.columns[:teaching_place].form_ui = :select
> >>> >> >    config.columns[:discipline].clear_link
> >>> >> >    config.columns[:groups].clear_link
> >>> >> >  end
> >>> >> > end
> >>> >> >
> >>> >> > 2010/9/21 Andrey Voronkov <[email protected]>:
> >>> >> >> I talking about this demo:
> >>> >> >> http://recordselect.codelevy.com/
> >>> >> >>
> >>> >> >> And no, there is no any requests when I'm typing.
> >>> >> >>
> >>> >> >> 2010/9/21 Andrey Voronkov <[email protected]>:
> >>> >> >>> when i've changed this:
> >>> >> >>> rs_("Next %d", page.pager.per_page) + " " +
> >>> >> >>> image_tag('record_select/next.gif', :alt => rs_('Next'))
> >>> >> >>>
> >>> >> >>> to this:
> >>> >> >>>
> >>> >> >>> image_tag('record_select/next.gif', :alt => rs_('Next')) + " " +
> >>> >> >>> rs_("Next %d", page.pager.per_page)
> >>> >> >>>
> >>> >> >>> it worked for me, before that next link contained html markup
> >>> >> >>> and no pretty arrow image
> >>> >> >>>
> >>> >> >>> 2010/9/21 Sergio Cambra .:: entreCables S.L. ::.
> >>> >
> >>> > <[email protected]>:
> >>> >> >>>> rs_("Next %d", page.pager.per_page) + " " +
> >>> >> >>>>
> >>> >> >>>>> image_tag('record_select/next.gif', :alt => rs_('Next'))
> >>> >
> >>> > --
> >>> > 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.
> >>
> >> --
> >> 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.

-- 
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.

Reply via email to