Displaying 20 results from an estimated 10000 matches similar to: "How to pass sorting values between pages...."
2006 Feb 23
6
Search Forms with Pagination
Hi there everyone, I''ve recently moved to RoR and am still struggling
with the basics of what used to be second nature in php, so on with
my question:
I have a database with products, and I need to create a search form
that paginates the results. What I have so far in my controller is:
def list
# If the values are nil, then set them, otherwise wrap them in %
# Also,
2006 Apr 16
7
table sorting
Ahoy,
I checked the API and did some forum searches but didn''t find anything
good on table sorting.
Is there a "railish" way to do this? My current method really is lacking
(i''m on like rails day 2)
<th><%= link_to ''Name'', :action => ''list'', :order => ''name'' %></th>
2006 Jan 08
2
sorting tables by columns
What I''m trying to do is have clickable column headers that will sort
the table by that column. What I have below works, except there is only
one variable storing the sort direction for all the columns, whereas I
need a separate one for each column name.
list view:
<th><%= link_to ''Category'', :action => ''list'', :order =>
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy,
I made this pager,
" def list
@item_pages = Paginator.new self, Item.count, 10, @params[''page'']
@items = Item.find :all, :conditions => "category_id =
#{params[:condition]}",
:limit => @item_pages.items_per_page,
:offset => @item_pages.current.offset
@categories = Category.find_all
2009 Jul 02
7
Params Merge and URL sorting/pagination
Hi all,
Here''s my general setup on the specific template I''m having issues with:
will_paginate for pagination
custom methods for sorting
1-form for team search
1-form for search by date
When searching for a team for instance, the url returned will be:
/rushing_offenses?search=Florida
When searching by date, the url returned will be:
/rushing_offenses?compiled_on=2009-07-02
2006 Feb 10
3
sorting <a href..> with D&D follows the link (browser thinks I click)
Hi all,
I''ve just added d&d sorting to a list where each item is a link_to ..
Problem: when I drop an item to its new location, the browser think I
clicked, and follows the link.
Any idea?
TIA.
Alain
2010 Oct 18
5
How to create a "like" button
Ive got a like and video model.
On a Video page, Users can click a link ("like") button which will
allow them to like a particular video.
Since my like button/image comes in the form of a link and not an
actual html form. How should this be implemented? Do I need to specify
a ":method => puts" in my link_to tag helper?
What are your thoughts?
--
You received this
2018 Feb 08
2
[PATCH] syslinux/com32: Fix the printing of left zero padded hexadecimals with a leading '0x'.
From: Brett Walker <brett.walker at geometry.com.au>
When printing hexadecimal numbers to a fixed width, padded with leading zeros,
and also having a leading '0x'; the resultant string can be shortened by up to
two characters if any leading zero padding character required is.
int hexnum = 0x00001234;
printf("%08X", hexnum); // results in 00001234
2006 Jun 07
2
Hash flattening on paginator link_to
Hey
I need some help with pagination and the link_to in the view.
I''m trying to include a hash in the pagination link_to params and it
keeps flattening out my hash.
Example:
Here''s my hash called @answer:
"answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3",
"7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2006 Mar 31
4
Question about pagination
Hi!
I''ve got a list of project on the main page and if one of them is
selected i render a partial using ajax with data of selected project.
How to create links to next/previous project using pagination?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 08
7
DRY methodology
because I am a grasshopper...
Now that I can sort my ''list''...is there a logical way of not repeating
myself to having essentially the same list view with multiple sorts?
i.e.
def list_cl
# ordered by clients last name
@placement_pages, @placements = paginate(
:placements,
:include => [:client],
:order_by =>
2008 Jul 14
1
will_paginate paginates all instead of subclass
I''m still a newb but having fun - Any help on this problem will be
much appreciated.
I have mymodel Call.rb
class Call < ActiveRecord::Base
belongs_to :user
has_many:visits, :dependent => :destroy
has_many:visits do
def latest
find :all, :order => ''id DESC'', :limit => 3
end
def all_latest
find
2005 Dec 31
3
Semi-Dynamic table sorting (without AJAX)
In a previous thread some people were interested in ways to sort a
table. I mentioned a simple method for doing so by using links in the
titles. Having actually tried to implement this strategy, I have come
across several refinements that I would like to share.
First...
your table view should look like this...
...
<table>
<tr>
<th><%= link_to
2006 Sep 08
4
Debugging not triggered...
I tried using the
killall -USR1 mongrel_rails
to check on a problem, and all I get is
mongrel_rails: no process killed
Nothing shows in the log. Any ideas? I''m using the latest
pre-release, and a ''ps'' shows my cluster is running.
Cheers,
Brett
2006 Jan 28
8
how to pass search parameters to pagination links
I have a search page with a text_field as below
<%= text_field ''program'', ''program_name'' %>
After I perform the search in my controller I go to a search results
view which shows search results and uses Rails pagination. Now how to
pass the search paramters (i.e. params[:program][:program_name] in my
controller) to the pagination links (next and
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone,
I''m at the end of my rope on this. I can''t get pagination to work
with anything but a standard find on a model. If I try to do a search
and customize the pagination, I get lots of different variations.
My thought was to have the list action do what it does, but to pass it
a list of search conditions from the search action. So, if search
determines that we need
2006 Aug 07
2
Autostarting and job keys...
I''ve now got 5 processes auto started. But I when I query the
MiddleMan for their keys (in script/console), it doesn''t find them.
Looking at the start script, it looks like it might be creating a new
MiddleMan object for each autostart
BackgrounDRb::MiddleMan.new.new_worker(:class => entry[''class''],
Even changing it to
2006 Aug 07
2
Process status...
I''ve used Railscron in a couple instances, and I liked that fact that
it has a rake task for checking the status of the process. Many times
I use it in the admin interface to allow me to double check that
everything is up and running.
I couldn''t find one for backgroundrb, so here is a simple one.
Probably obvious to everyone, and no doubt there is a better way to do
it:
2006 Aug 07
3
repeat_every doesn''t tie in with first_run...
Ezra,
Sorry for inundating the list. In using the autostart, repeat_every,
and first_run, I noticed a behaviour I didn''t expect.
I would like the job to run starting at 2am, and then every 24 hours.
So I set first_run to Time.now.beginning_of_day + 2.hours, and
repeat_every to 24.hours.
The problem is if backgroundrb starts up at 6am (due to a code change
or server bump), then the
2006 Apr 07
2
Paginate single items
Hi,
In my blog i display a post. I want to display a link tot he previous
post if there is 1 and a link tot he next post if there is one.
So i have in my controller
def post
@post = Post.find(params[:id])
@post_pages, @posts = paginate :posts, :per_page => 1
render(:layout => false)
end
And the following code in post.rhtml
<% if @post_pages.current.next %>
<%=