19 Jul 23:52
Routes
From: Johan Mickelin <rails-mailing-list@...>
Subject: Routes
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-19 21:52:16 GMT
Subject: Routes
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-19 21:52:16 GMT
Hi there,
I'm having an issue with routes I frankly dont get.
I have a controller named map which takes in a hash string and converts
that to an actual url, works great
so localhost:3000/f3gg or whatever works fine
now, I have a controller which I want to use to add some records (needs
to go through AJAX)
I want two strings, from and to but nevermind that for now since I'm too
stupid to even get one string working
my routes.rb look like this
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
map.connect ':map', :controller=>'map', :action=> 'index'
map.connect ':from', :controller=>'share', :action=> 'index'
map.connect '', :controller => "map"
the map one in the middle works fine, the controller looks like this:
(cut out all the irrelevant stuff)
class MapController < ApplicationController
def index
@map = getmap
end
def getmap
(Continue reading)
RSS Feed