Displaying 20 results from an estimated 2000 matches similar to: "How to override pagination_links method"
2006 Jan 19
8
Pagination_links without "?page=" but with params[:id]
Hello,
With default pagination I have this :
<a href="/users/infos/3?page=1">1</a>
<a href="/users/infos/3?page=3">3</a>
but i need this :
<a href="/users/infos/1">1</a>
<a href="/users/infos/3">3</a>
I need to remove the "?page=" parameters and rewrite a little the link ( with a link_to ? )
2006 Jul 12
2
Problem w/ Rails 1.1.4 and pagination_links using params?
I just installed version 1.1.4 and it seems like I started having
problems with the pagination_links method. When I call the method using
something like this (using the :params option--and this seems to be the
problem),
<%= pagination_links @todo_pages, :params => params %>
then it duplicates part of the controller in the generated url. For
example, before one of my paginator links
2006 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like
?page=1&foo=bar. I can''t quite figure out how to do this with the
pagination_links helper, although I believe the API says you should be
able to:
pagination_links(paginator, options={}, html_options={})
options are:
:params: any additional routing parameters for page URLs
Has anyone tried this?
thanks,
jeff
--
2006 Jul 23
2
pagination_links and friendly urls
my pagination_links seems to auto generate the links using the current
controller, action and id. The page they''re appearing on however have a
friendly url I have created. I want to be able to make pagination urls
generated by pagination_links "user friendly" as well so that they match
my current naming convention.....i know there must be a way to do
this....any ideas?
2006 Nov 17
4
set empty values as null in the database
Le''s say that I have a table called people and the column middle_name is
nullable. If the user enters say blank or empty space then in the database
it is recorded as empty space. I would like in all my models all empty
spaces to be recorded as null.
I guess I can write a plugin which will do so for all the models but I''m
sure something like that should already be existing.I
2006 Aug 09
6
How to change the error message easy way
validates_presence_of :fname
results in the error message
"Fname can''t be blank".
What I want is "First Name can''t be blank".
I could do this
def validate
errors.add_to_base("First Name can''t be blank") if fname.blank?
end
I find this clunky and I have to put everyrhing in the validate method. Is
there an easy to get what I want.
I
2005 Oct 25
3
How to get the source code for login generator
Hi,
I installed login generator using gem. It''s installed and it''s working fine.
I wanted to browse the source code of login generator installed by gem. I
couldn''t find the source code anywhere.
Thanks.
-=- Neeraj
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 Jul 26
2
How to highlight the search term in the search result
In the ''basecamp'' product from 37signals if I search for ''ruby'' the I get a
bunch of results. In the search result page the search term (ruby in this
case) is highlighted.
I was wondering how to accomplish the same.
How to highlight the ''search term'' in the search result? Is there any
already existing utility that I could use?
Thanks.
2006 Jan 31
2
Relationship navigation issue
class Event < ActiveRecord::Base
belongs_to :venue
belongs_to :category
end
class Venue < ActiveRecord::Base
belongs_to :city
end
class City < ActiveRecord::Base
belongs_to :state
end
I want to retrieve all event records belonging to a state. Coming from
hibernate background I tried something like this:
def self.list_for_a_state(state_id)
find_by_sql(["select e.*
2006 Jul 05
2
How to write get functional test when there is no action by that name
I have following line in route.rb
#event info for an event name
map.connect ''event/:name_url'',:controller => ''home'',:action =>
''event_info''
It causes a URL like http://localhost:3000/event/_jewels_exhibition_ to be
sent to the home controller with action as ''event_info''.
I am trying to test this action. My first
2007 May 28
2
helper with block compile error
HI,
i''m trying to write a helper that replaces link_to_remote that
accepts a block but it gets a compile error in the template:
I don''t know what I''m doing wrong... TIA
# application_helper.rb
def link_block_to_remote( options = {}, html_options = {}, &block)
concat(link_to_remote(capture(&block), options, html_options),
block.binding)
end
# in
2006 Jan 31
0
pagination_links - change anchor size?
Has anybody figured out a way to change the anchor size in
pagination_links? I''d like links like:
1 2 3 ... 7 8 9 10 11 ... 15 16 17
Thanks!
csn
--
Posted via http://www.ruby-forum.com/.
2006 Jan 14
3
How to render from a different controller
My code is something like this.
class FirstController < ApplicationController
def foo
#some processing
render (:controller => ''second'', :action => ''index'')
end
end
I tried using both render and redirect but it seems it''s not possible to
send the control from within a controller to some other controller. Am I
missing something
2006 Apr 06
1
Rendering partials with pagination
I currently have a call to this action, which I''d like to paginate:
def get_words
@catid = params[:category]
@words = Category.find(@catid).words
render :partial => "word_display", :collection => @words
end
As you can see, a word_display partial is rendered for each word.
If I add the pagination call (getting the links object), how can I then
get
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
The built-in Rails pagination is fairly limited...you pass in the
model name, and optionally some conditions, and it generates a
paginated query for you. This gets to be very bad if you''ve got any
custom queries.
class Company < ActiveRecord::Base
def complete_videos
Video.find :all, :conditions => "company_id=#{id} AND
status=''complete''", :order
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/.
2005 Oct 14
1
Diff between attr_accessible and attr_accessor
I''m going though the paper back edition of agile development with Rails. On
page #128 I encountered following lines of code:
attr_accessor :password
attr_accessible :name,:password
What''s the difference between attr_accessor and attr_accessible?
-=- Neeraj
_______________________________________________
Rails mailing list
2008 Jun 26
2
Problem with date_select after Rails 2.1 upgrade
Folks,
I think I should start a new thread for this, because a similar one I
saw is a bit old and the resolution there doesn''t seem to apply to
what I''m running into now.
Anyway, my date_select calls are bombing on me with the exception:
----
ActionView::TemplateError (wrong number of arguments (3 for 2)) on
line #8 of entries/_dates_form.haml:
8: = date_select(
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2006 Jun 12
6
Prototype Window Class v0.85
Hi
I just want to annouce a new release of my Prototype Window Class
with a new website with full documentation and new samples (I hope
it''s easier to understand now :)).
http://prototype-window.xilinus.com/
Thanks again to all of you guys for your help.
Seb
PS Dj T, have you finished your Rails plugin?