Hi, I am pretty new to CodeIgniter and PHP in general and have two questions that are somewhat related.
I have a nested category tree with unlimited depth that produces links like myapp.com/language and myapp.com/spanish but I would like to have something like myapp.com/language/spanish.
For reference my model returns an array of array...
I'm trying to make a named route 'have_many' other named routes here. But the way I'm doing it's not working.
Here is my problem:
I've several game platforms that I want to access by /:platform_name/. This is working:
map.platform ':platform_name',
:controller => :platforms,
:action => :index,
...
Hello, I've started this question http://stackoverflow.com/questions/2370882/named-route-with-nested-resources, and it lead me to this new one.
I've a named route defined in my routes:
map.game ':platform_name/:game_name',
:controller => :games,
:action => :index,
:platform_name => /pc|...
I'm using static URLs in my RoR project. There is really no controller or action to map to so I tried putting in map.root "/static_page" or map.root "static_page" but I get errors. How do I just map to a path?
Edit: I am using a controller to serve up static pages, these aren't html pages, but a static controller I'm using here: http://...
Im not sure if I'm doing this right. I have an action that I would like to either copy, create, and save a new object if a user is logged in, or redirect if they are not logged in. Im not using a form here because I am using a stylized button with an image that looks like this:
<a href="/lists/add/<%= @list.id %>" class="button">
<s...
I'm looking to make a show action of one of my controllers the root.
I can easily do this:
map.root :controller => 'articles', :action => 'index'
When I go to localhost:3000/ it lists all the articles - that's great!
What I want to achieve, though, is a URL like this
localhost:3000/1
To display an article with the id 1.
Changing th...
I have a simple MVC site but I need to add in some static HTML pages, I have tried to add an IgnoreRoute in for .html files but this didn't work.
...
Hi, I've been playing around with creating an e-commerce site with Codeigniter, and am trying to do the following:
Have category names as the first parameter, e.g.
/tshirts
/shoes
following each of these, is either a filter (on the category), or the product (with category in URL for SEO)
/tshirts/filter/price/0-20
/tshirts/pink-wi...
I've a controller :platform here.
I'm trying to do something like:
/:platform_name/ to redirect to its show, with the parameter. Here is what I've got:
map.resource :platform,
:as => ':platform_name',
:platform_name => /pc|ps2|ps3|wii|ds|psp|xbox-360/
It's working fine. I've other neasted resources to i...
I've created a new Pylons application and added a controller ("main.py") with a template ("index.mako"). Now the URL http://myserver/main/index works. How do I make this the default page, ie. the one returned when I browse to http://myserver/ ?
I've already added a default route in routing.py:
def make_map():
"""Create, configure a...
looking for a one line route to route dashed controller and method names to the actual underscored controller and method names.
url
/controller-name/method-name-which-is-long/
would route to
/controller_name/method_name_which_is_long/
see: http://codeigniter.com/forums/viewreply/696690/ which gave me the idea to ask :)
...
Hi.
I have a controller named Content, which has an Index action, which is associated with a view.
I would like the simple route "content" to show me the index view of the content controller, so I use the following code (with the addition of the default site home route):
routes.MapRoute(
"ContentIndex",
...
Hi folks,
I have the following route's defined:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
// Added custom route...
I have a rails app.
I have a file in #{RAILS_ROOT}/public/swfs/somthing.swf.
Locally, when running with webrick, when I go to the url
localhost:3000/swfs/something.swf, my swf loads just fine.
My routes.rb file looks like the following
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
map.conn...
Im trying make a login page for my rails application that looks like "www.domain.com" and when you login you still are still located at the domain "www.domain.com". Is there a way that I can map 2 different actions to the same url using routes. Twitter does it this way, you log in at twitter.com and after you are logged in you are still ...
I have an admin controller located inside /controllers/admin/admin_controller.rb
I also have a pages controller located inside /controllers/admin/pages_controller.rb
In my routes.rb file, I have the following:
map.namespace :admin do |admin|
admin.resources :pages
end
When the user goes to localhost:3000/admin, I'd like the us...
I am attempting to beautify my routes so that they follow the syntax of lists/name-of-list/id as per here: http://gregmoreno.ca/how-to-create-google-friendly-urls-in-rails/
I have defined a new route like so:
map.list_permalink 'lists/:name/:id', :controller => 'lists', :action => 'show'
Everything works fine, but my existing ajax met...
i have defined a method called 'search' in my RecipesController which is not private. in routes.rb i have the following:
map.connect 'recipes/search', :controller => :recipes, :action => :search
i get the following error:
No action responded to search.
Actions: ...
where my method 'search' does not appear in the actions list...
In my Pylons app, some content is located at URLs that look like http://mysite/data/31415. Users can go to that URL directly, or search for "31415" via the search page. My constraints, however, mean that http://mysite/data/000031415 should go to the same page as the above, as should searches for "0000000000031415." Can I strip leading...
I'm trying to access my pylons application via cron job to send notifications to my users. The way I'm doing this is by running the application using something like:
paster request myconfig.ini /maintenance/do
In the actual controller I check for the "paste.command_request" to block public access. Everything works but the only problem...