Forum: Ruby on Rails pagination on modal window

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B736ee289a70ae21e323ed2f808dd0ce?d=identicon&s=25 dare ruby (martin_mercy2001)
on 2009-01-31 06:40
Dear all,

I have implemented a modal window for selection of user. How i can
implement pagination for modal window. I have used the following
controller method for displaying user in modal window

def user_search

    @user_list = UserInfo.find( :all,:page => {:current =>
@page_current,
                             :size => 10 }, :conditions => ['id != ?',
1])

    render :update do |page|

      page.show "userlist"

      page.replace_html "userlist", :partial =>'user_list', :locals =>
{:userlist => @user_list}

      page << "showModal('contatiner_sub','userlist')"

    end
end

_user_list.rhtml:

<div id='modal-contact'>
    <div>

      <% userlist.each do |user_list| %>

        <%=radio_button_tag
'user_name_1',"#{user_list.id}"%><%=user_list.first_name%><br>

        <%= observe_field("user_name_1_#{user_list.id}",
        :on => "changed",
        :url => {:action => :update_user, :id => user_list.id},
        :with => "'user_name='+value")
        %>

      <% end %>

    </div>
    <div id='pagination'>
         <%= render :partial => '/application/pagination',
              :locals =>
                { :collection =>  userlist,
                  :action => 'user_search',
                  :id => nil
                  }  -%>

    </div>
</div>


Please suggest on above code for implementing pagination in modal
window. Pagination works fine in all my normal lists but in modal window
it does,nt work. Please suggest.

Thanks in advance

Regards,
Jose Martin
This topic is locked and can not be replied to.