Displaying 20 results from an estimated 2000 matches similar to: "Does Rails need more useful URL helpers?"
2010 Sep 04
4
Store a single variable / row in database
What would be the best way in rails to store a single variable and have
it persist. Like a have a variable that says "total_visits" that counts
the total number of page loads.
The only solution I can think of is having a table with a single row.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Aug 09
3
rel=nofollow or akismet
Hi guys,
My site ( http://shunya.in ) recently started receiving some spam and I had
ignored the issue till it became a problem, and I guess it is becoming a
problem now.
I looked around on suggested ways to address the problem and found two
systems - CAPTCH and Akismet. I consider both of them in this email along
with the reasons why I am debating using neither of them. Then I ask for your
2010 Jul 20
2
uninitialized constant WillPaginate::LinkRenderer
This is becoming painful. Where the file should be? What should be in
it? I am running will_paginate 3.0.pre
Here is my current code sitting in initializers/
class WillPaginateRenderer < WillPaginate::LinkRenderer
def rel_value(page)
"nofollow"
end
end
Thanks for your help,
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed
2006 Nov 21
1
fix for modularized controller using overwrite_params
Hey guys,
I realized some people have had problems with nested controllers and the
:overwrite_params call. The way I fixed it is like this:
:overwrite_params=>{:controller=>"/#{params[:controller]}"}
I would love to see if other people could improve on this, its not the
prettiest thing.
--
Posted via http://www.ruby-forum.com/.
2006 May 30
2
acts_as_queue
wondering if anyone tried this patch. (i havent, seeing as its 1228
lines long, 10 months old, and cant take serious a patch many orders
larger than competing web frameworks)
in many cases i want to keep about 10 things around, eg recent searches,
new items (spanning multiple classes), referers, page views, without
logging them for perpetuity. so i guess this isnt a normal queue, more
like a
2005 Mar 03
0
where is :overwrite_params ?
HI,
it seems the :overwrite_params option has disappeared from the
url_builder. Is there a reason or is it just a side effect of the new
routes? Any chances to see it coming back?
If that matters, I use it a lot :-)
Raph
PS:
For those who don''t know it, it lets you use the current @params as
parameters for eg link_to, just overwriting the values you want.
For example, when displaying
2009 Mar 30
3
Great discrepancy between Google Analytics and own counter
Got Google Analytics running on one of my websites. Google defines a
pageview as the most occuring event. Every refresh, every link clicked
to a different part of the page, even loading from cache is an
additional pageview
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=57164
Now it should be known that GA is JS based, and will report directly to
Google from the
2005 Sep 06
4
url_for: :overwrite_params went missing
Somewhere between 0.13.1 and the current SVN version
the :overwrite_params option to url_for (and related methods) went
missing. I can''t tell whether this was deliberate or by mistake, and I
have no idea how to get the same functionality in some other way
either.
Michael
--
Michael Schuerig Life is what happens
2006 Aug 09
1
How to Disable Callbacks on a Model
Does anyone know how to disable a model''s callbacks?
I have a routine that increments a page_view counter for various model
objects in an after_filter in my ApplicationController. I call this:
increment_page_view()
Rather that checking through the trace array in each model callback for
"increment_page_view" I''d rather disable the callbacks from inside
2005 Nov 19
1
link_to weirdness
Hi,
I''ve got a page running at say http://example.com:3000/admin/players
Then I''ve this bit of code to generate a URL like:
http://example.com:3000/admin/players?order_col=fname&order_dir=desc
<%=link_to col[:label], :overwrite_params => {
:order_col => col[:field],
:order_dir => @order_dir == ''asc'' ? ''desc'' :
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 Jul 16
3
pagination over custom-sorted collections?
I have a little web app where we need to paginate collections of
items. I''m trying to sort the collection and then pass it, sorted, to
a Paginator, and still be able to paginate through the collection,
across several pages, with the new sort order. The only thing I''m
doing differently from the regular scaffolding approach is this:
@order_pages = Paginator.new(self,
2009 Mar 03
4
failed assertion in 1.1.8: istream.c: line 81
Hello,
We're having a problem in Dovecot 1.1.8 with a failed assertion on
certain mbox format mailboxes. It happens both with deliver when it
attempts to delier to the mailbox, and with IMAP connections for the
affected box (though I'm not sure what they're doing at the time).
Mar 3 12:55:26 <snip> dovecot: Panic: IMAP(<snip>): file istream.c:
line 81 (i_stream_read):
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code:
@project_pages, @projects= paginate :project,
:per_page => 10,
:conditions => ["account_id = ?", account]
?!
If only I could pass the sub-collection
account = ...
@projects = account.project
to paginate, instead of letting it extract it with a find :all + sql
conditions
Alain.
--
Posted via
2005 Dec 19
6
custom find methods and pagination
i''ve got several methods in my models i use to find based on certain
criteria...i''ve done this so the controller code is less cluttered, plus the
DRY factor.
example:
class Foo < ActiveRecord::Base
def find_by_something(something)
find :all, :joins => ..., :conditions => ...
end
def find_by_something_else(something_else)
find :all, :joins => ...,
2006 Jun 29
3
Speeding up Prototype''s $$ Selector
Just a quick heads up that Sylvain Zimmer has posted a performance
upgrade for Prototype''s $$ selector, making the function up to 20 times
faster.
This could be just the thing I''ve been looking for recently as a site
I''m currently developing makes heavy usage of that $$ selector and I
have noticed that this can lead to a noticeable lag on page load.
See
2006 Apr 18
1
Pagination links with separator
Hi,
I have @result_pages and @results obtained from paginate in an action. I
want to show the pages as
1 | 2 | 3 | 4 >
The fifth page will show:
< 5 | 6 | 7 | 8 >
and so on.
How exactly do I render the paginator to give this effect? I guess I
will have to use pagination_links_each. But being new to Rails, I need
help.
Thanks,
Yash
--
Posted via http://www.ruby-forum.com/.
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there,
I''ve been trying to paginate over a list of members that all share a tag in
common using the acts_as_taggable plugin. The regular way of paginating over
a collection doesn''t seem to work with acts_as_taggable. Here''s what my
method looks like that takes in a tag name, finds all the members that share
the tag and then displays all the members. Nothing too fancy
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like