Ajax pagination links: Create pagination links with link_to_remote

Published on

Here is a method by mixonix to create pagination links by link_to_remote. Copy this code in your helpers/application_helper.rb [source:ruby] def ajax_pagination_links(paginator, options={}) options.merge!(ActionView::Helpers::PaginationHelper::DEFAULT_OPTIONS) {|key, old, new| old} window_pages = paginator.current.window(options[:window_size]).pages return if window_pages.length { options[:name] => first }.update(options[:params] )) html 1 html page }.update(options[:params] )) end html { options[:name] => last }.update( options[:params])) end end … Continue reading Ajax pagination links: Create pagination links with link_to_remote

Tab Problem in rails .rhtml files

Published on

The situation was: running Ruby 1.8.4, Rails 1.1.2, on WinXP & WEBrick server. My application was working fine, but as I installed Rmagick my application crashed. I got strange errors like: compile error /script/../config/../app/views/layouts/application.rhtml:18: parse error, unexpected $, expecting kEND if I refresh again the error actually changes(further refreshes flip back & forth between errors): … Continue reading Tab Problem in rails .rhtml files