Displaying 20 results from an estimated 40000 matches similar to: "Multiple actions for one route (making pretty URLs hit different actions)"
2006 Jul 02
5
Pretty URLs -> Routes
Hi
I am having issues with getting my pretty urls to work.
routes.rb:
map.connect '':user'' , :controller => ''front'' ,
:action => ''list'' ,
:filter => ''user''
front_controller.rb:
def list
@advert_pages, @adverts = paginate :adverts, :per_page => 10
@user =
2006 Aug 08
2
Resources and pretty URLS
Using the brand-spanking new map.resources for REST goodness, is there a
way to pass in additional parameters, or do I have to go back to
standard routes. For example, is there a way to use the map.resources
to response to urls like:
/blog/2005/02/03/ => :controller => :blog, :action => :show, :year =>
2005, :month => ''02'', :day => ''03''
2006 Apr 07
2
Functional testing Pretty Urls
Anyone know how to how to test pretty urls (set through routes.rb)? I want
to don''t use get :action, because the routing changes how a certain action
is requested. How does one go about testing this?
Thanks,
Tim Case
tim@karmacrash.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Mar 05
0
Pagination + pretty URLs
Hello all.
I want to make pagination URLs pretty instead of the ?page=2. I have
written a route like this:
map.connect ''restaurant/list_dishes/:page'',
:controller => ''restaurant'',
:action => ''list_dishes'',
:requirements => { :page => /\d+/},
:page => nil
Which appears to work. However the following only
2011 Apr 09
1
Pretty URLs for omega?
Hello :-)
How can the default omega URL be prettified?
http://<host_ID>/cgi-bin/omega is working fine, giving us all omega's
default CGI parameters. Now we want multiple databases which could be
accessed using http://<host_ID>/cgi-bin/omega?DB=<index_ID> but this is
starting to get messy. It will get messier when we start to customise
templates with
2008 Sep 23
5
Problem getting Rails to emit the correct (proxy) domain in route urls
Behind the scenes my app runs like this:
http://myapp.mydomain.com/myapp and
and
https://myapp.mydomain.com/myapp
are Apache 2.2 virtual hosts proxy-balanced to a mongrel cluster
on the same machine.
But I need to make these available here:
https://www.mydomain.com/myapp
and
https://myapp.mydomain.com/myapp
are on a second server using ProxyPass and ProxyPassReverse to
2006 Aug 17
2
One common template for different actions ?? possible or not?
Hi all,
Hey I want to know that, is it possible to have commont templates for
different methods(actions) in the controller?
Please reply!
--
Regards,
Anil Wadghule
http://anilw.info
Don''t live to geek; geek to live.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/54bee41d/attachment.html
2010 Jun 23
0
gathering all links and transforming them to absolute urls
I''m trying to look at a page, and get all the urls for the links as absolute urls. I searched briefly, and couldn''t find any answers for the ruby version. Is this kind of operation supported? or do I have to do it by hand.
#what I tried, this doesn''t work :( !!!
uris = []
page.links.each {|x| y.push(x.uri()) }
# or page.links.each {|x| y.push(x.href) }
Thanks!
Soyoung
2010 Aug 12
4
[Rails 3] How to test routes urls in console
I tried require ''url_writer''
but this is not the trick
what should be required/included to test the routes urls ?
thanks
erwin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb:
map.resources :product_categories
it provides urls such as:
/product_categories
/product_categories/1
/product_categories/1;edit
etc.
and uses the ProductCategories controller.
how can I keep the same controller (and model) but set up the resources
so that I can have any abitrary url point to the existing controller,
much like specifying the controller
2006 May 19
0
Multiple Sum/Average/Max/etc in one query
Hi all, I was wondering how one does multiple sum/average/max/min in a
single query using AR.
It would be cool to be able to do:
totals = Call.sum([:price,:duration], { :conditions => "destination =
''UK''", :group => "location" })
and end up with a hash with totals[:location][:colname]
e.g.:
2013 Sep 19
0
Performance problem generating URL for thousands of images, due to hitting HDD for each one
Hi,
I have a model where I''m using Carrierwave to let users upload their
avatars. I have one version for the avatar, cropped to a square called
"cropped".
class User
mount_uploader :avatar, AvatarUploader
end
class AvatarUploader < ImageUploader
version :cropped do
process :crop
end
end
In one of my pages, where I''m listing a few thousand users,
2008 Mar 10
0
Cannot route new actions added to a controller in Rails 2.0.2
Does anyone know of a good tutorial on routing for Rails 2.0.2? I
added a new method to one of my controllers and when I point to it by
localhost/:controller/:action, I can''t see it!
In my routes.rb file, I''ve got:
map.connect ":controller/:action"
map.connect ":controller/:action/:id"
and I''ve stopped and restarted the server
2007 Feb 20
1
Urls generated by nested map.resources
Hi,
Apologies if this has been answered before.
I have just started to try out the new RESTful routes. For resources
that aren''t related to anything else, everything makes sense - for
resources with relationships, I am less certain of what the "right"
thing to do - especially in relation to the urls produced, and how to
modify those urls.
For example, if I have teams and
2006 Jan 26
1
[R-SIG-Mac] Hist for different levels of a factor
The list of your interest is R-help not R-sig-mac
stefano
Il giorno 26/gen/06, alle ore 01:20, Sylvain Charlat ha scritto:
> Hi,
>
> Is there any simple way to get histogram for different levels of
> factor?
>
> Say you have the following data set:
>
> Island Sp.diam
> Moorea 1.21
> Moorea 1.27
> Moorea 1.28
> Moorea 1.22
> Moorea 1.28
> Rurutu
2006 Apr 12
6
distinguishing mapped urls from ordinary action urls
I want to present different view depending on the url.
example below:
http://myapp/start/show?url=xZq
http://myapp/xZq
both addresses are controlled by a single controller and the same action.
the second url is only mapped in routes.rb
how can I distinguished the mapped url and present a slightly different view
in it?
Sabon
-------------- next part --------------
An HTML attachment was
2006 Jan 28
1
Switchtower different svn repo urls from my local box and my shared hosting
I got problems running switchtower 0.10.0 when I try to run "rake deploy"
from my local box (windows) to my shared hosting
If I set the repository to (deploy.rb):
set :repository, "file:///home/[my_user]/repo/[my_app]/trunk"
My local box (windows) can''t reach the subversion repository located in
site5
If I set the repository to:
set :repository,
2018 Jan 23
1
Scraping from different level URLs website
I am doing a research on World Bank (WB) projects on developing countries. To do so, I am scraping their website in order to collect the data I am interested in.
The structure of the webpage I want to scrape is the following:
1. List of countries the list of all countries in which WB has developed projects<http://projects.worldbank.org/country?lang=en&page=>
1.1. By clicking on a
2006 Jul 31
3
Simply_RESTful and Bulk Import URLs
Hi,
I have a people controller, and want to import bulk import multiple
people from a CSV file.
In my routes.rb file I have:
map.resource :person
Now, it''s a little unclear to me how to further configure the routes to
allow me to add the following URLs:
I need a URL to choose a file to upload, so I need an HTML ''frontend''
for it, so I figured the following URL
2006 Jun 10
2
Migrating to rails... best way to redirect old urls?
Hey all -
I''m migrating an app from PHP to Rails and was wondering what the best way
to redirect the old urls are. I would like to do a 301 as I''m told that
makes Google the happiest.
We''re using lighty as the server and I believe it has rewrite
capabilities, but I can''t get to their site right now.
Anyway, I''m wondering if it''s best