Displaying 20 results from an estimated 13000 matches similar to: "Multiple Paginators with Independent Paging"
2006 Jun 02
3
Custom Pagination Links
Hi,
I''m using the code below to display some pagination links. It works
great apart from when there''s no paging i.e. the full collection is
displayed, when it still display a "1" to represent the current page.
How can I suppress that?
Thanks!
<div class="pager">
<%= link_to(''< Prev'', {:params =>
2006 Apr 25
6
Does Rails need more useful URL helpers?
Similar topic to my last post, but a different brand of methods. In
particular, the url_for and link_to methods have come to bother me at
times. I will mention one instance in particular:
I am designing a high-end administrative interface. This interface
supports paging, sorting and limiting to specific field values. Thus I
have params named page, sort and limit.
The lack of elegance I see
2006 Jun 03
3
Disable Migration creation in generate Model
Hi....
Is there some way to configure Rails to not create a
db/migrate/###_model_name.rb when I do a script/generate model
ModelName?
It''s a little annoying when I''m setting up a new application since I
prefer creating all the first tables in a 001_inital_schema.rb file.
Then when I generate models for those tables I get migration scripts
for all of them again that I have to
2006 Jul 22
3
How do you find out what action rendered a page
Hi I have this list page that has some rjs templates updating parts of
it including a table of results. i''m trying to put pagination on the
table. thing is lots of different actions update the table and they have
their own paginators.
anyway i have this code at the bottom which worked for another page
<%=
pagination_links_each(@offer_pages,:window_size =>4) do |n|
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 May 07
3
Webrick not showing sql queries any more?
Hi all,
I updated rails to 1.1.2, and somehow, when I run script/server on a new
rails project, I don''t see the sql queries in the console any more... It
was very useful to see them live...
Does any one have any idea why?
Thank you very much!
Nauhaie
--
Posted via http://www.ruby-forum.com/.
2006 Apr 30
7
Rich text aera?
Hi all,
I am trying to add an article editing interface to my future webstore,
and I am wondering what to use for text formatting.
I would like to avoid using HTML, and calibre-bbcode just won''t work
(see my last post).
Is there some kind of library for live text formatting right in the
browser? I would just need bold, italics, size and ul lists... Do you
know of a good solution?
2007 Oct 22
5
How to hook into model attribute changes?
Hi,
What''s the best way to hook into any changes made to the value of a
single model attribute? I need to know when the encrypted_password
attribute on my User model changes i.e. when the user has changed their
password. I''m not interested in the actual changed value, I just need to
know when it''s been changed so that I can regenerate their API key as
well.
Thanks in
2009 Mar 27
1
using pagination to group pages by attribute value
Hi -
I''m trying to group records based on some attribute they or an
association of their''s have. The simplest example I could think of to
drive my point is this:
Assume the following model associations (pardon my butchering of rails)
-
Faculty has_many :courses
Course belongs_to :faculty
I want to paginate courses based on the name of the faculty they belong
to.
The paging
2005 Dec 19
2
Advanced search/filter use cases
I''ve been working on an application lately that has a lot of advanced
search and filtering functionality (with ranges and substring searches
for each attribute). Despite being a pretty common use case, this isn''t
supported particularly well by any framework I''ve used, including Rails.
I''d like to fix that. :)
Right now, my major pet peeves are:
1. Long,
2006 Jul 16
6
Apache2.2 + Mongrel: what do you think about these perfs?
Hi all,
I''ve been spending quite a lot of time trying to install a decent RoR
server on my dedicated server (Ubuntu 6.06 LTS), and now, everything
works.
However, the performances are not really what I had expected... I would
like to know what you think about it.
Here is my config: 2GHz VIA proc, 1Gb RAM, SATA-II HD.
I have apt-got ruby 1.8.4, mysql5 and installed rails 1.1.4 by
2009 Aug 18
4
pagination problem....
Hi,
please help...
In controller...
def index
@customers = Customer.find(:all)
pagination code here....
end
In index.html.erb
Displayes list of customers and has pagination 1,2,3,4...etc.
On clicking page 2, it will again run this(Customer.find(:all)) query in
controller. So, there will be lack of performance.
So, how to increase the mysql performace? Can i use the index as below
or any
2006 Aug 03
12
More than one has_many :through association between the same 2 models
I wonder if you can have more than one has_many :through association between
2 models.
For example...
I have a model Teacher and a model Class
Now, 1 Teacher works in many Classes, right?. So I need a join model like
class Work < ActiveRecord::Base
belongs_to :teacher
belongs_to :class
end
But I also would like to know if a teacher CAN teach a class before I
2006 Apr 29
3
Post to a remote page
Hi all,
I am sorry if this question has already been replied here, but I did not
manage to find an answer.
I am looking for a way to post data to a remote web page. I don''t want
to use hidden fields and a submit button, I would just like some ruby
code that would post parametres to a web page and store the web page
that the remote server sends back.
I am not sure that I have been
2006 Oct 24
13
How can my boss take rails seriously with bugs like this?
The Time::next_week method is supposed to give the time of the start of
the next week. But look at this, it cocks up :
>> t=Time.parse "Monday October 16th 2006"
=> Mon Oct 16 00:00:00 BST 2006
>> t.next_week
=> Mon Oct 23 00:00:00 BST 2006
>> t.next_week.next_week
=> Tue Oct 24 00:00:00 BST 2006
>> t.next_week.next_week.next_week
=> Mon Oct 30
2006 Sep 18
2
RedCloth !image! bug with filter_html
Hi all!
I am trying tu set up RedCloth for user-submitted comments. And here is
my problem. The :filter_html option just breaks images :-(
For example, if I try in irb:
string= "Some textile !agif.gif! and textile again"
RedCloth.new(string, [:filter_html, :filter_styles]).to_html(:textile)
I get:
NoMethodError: You have a nil object when you didn''t expect it!
The error
2006 Apr 22
3
freeze_gems not freezing all gems?
Hi,
I am currently experimenting on rake freeze_gems and there is something
I do not understand.
When I freeze_gems my app, it puts Rails in the /vendor/ directory,
which works. But what about all other gems I have installed (for example
Unicode, sqlite support, mysql support and so on)?
The aim of freezing is to be independant of the versions of the ISP, but
it seems that the server still
2006 Jun 25
4
Zebra Striping a Collection of Partials
I''m using render to display a collection of partials, where each partial
is a table row. Is it possible to zebra-stripe the table using this
method i.e. alternate table rows get a different CSS class? I can''t work
out how each row partial would know whether it was odd or even.
In the normal scheme of things I could do:
<% odd_or_even = 0
for asset in @assets
2006 May 20
3
In a find, can''t you use both :include and :limit ?
I''m trying to do a find that includes a join. It has to be a find
because I''m using the results for a Pagination, so I need to limit my
query to the number of results I want to display per page.
Here''s the type of thing I want to do:
Employee table <-> Skills_Employees table <-> Skills table
Let''s say I want to find all the employees who have
2006 Aug 17
2
How to trigger an action from script/console
Hi,
I have build a conversion script from an old database to a new one
(which is designed to work with ROR), and every action converts one
table and takes over 5 minutes... When I trigger the actions from my
browser, I finally end up with a "Failed to start properly"...
So, simple question: How can I do this from the console, that is to say,
trigger one of my controller''s