Hi,
I searched a lot around the web but I couldn't find any specific sollution to this.
In CakePHP 1.3, different from 1.2, if you had a controller inside a plugin, and both had the same name, you could access through "<plugin>/<action>", and it would call the 'default' controller. But in 1.3, according to this:
http://cakeqs.org/eng/q...
Hello
I am using CodeIgniter for two applications (a public and an admin app).
The important elements of the document structure are:
/admin
/admin/.htaccess
/admin/index.html
/application
/application/admin
/application/public
/system
.htaccess
index.php
The /admin/.htaccess file looks like this:
DirectoryIndex index.php
RewriteEngi...
Hello everyone,
i need urls like /controller/verb/noun/id and my action methods would be verb+noun. for example i want /home/edit/team/3 to hit the action method
public ActionResult editteam(int id){}
i have following route in my global.asax file.
routes.MapRoute(
"test",
"{controller}.mvc/{verb}/{noun}/...
When clicked on the link below, it takes me to the show screen, instead of deleting the thing.
<th><%= link_to 'Destroy', blog, :method => :delete %></th>
Controller
def destroy
@blog = Blog.find(params[:id])
@blog.destroy
respond_to do |format|
format.html { redirect_to(root_path) }
format.xml { hea...
I am in the process of creating a web app. Since I admire the directness of Twitter's URL scheme for user pages, I'm trying to emulate them. I'd like my users' profile pages to be available at http://myapp.com/user_chosen_identifier. Right now I have some basic code for ensuring RFC3305 compliance with what I put in a URL, but I'm more...
For some strange reason cardsets_path('my') generates "/cardsets.my" instead of "/cardsets/my". Please explain why?
config/routes.rb:
match '/cardsets/:type', :to => 'cardsets#index', :requirements => { :type => /my|public/ }, :as => 'cardsets'
resources :users do
resources :cardsets do
end
end
rake routes:
cardsets /cardsets/:...
Hi,
So I have added this route to my map:
routes.MapRoute(
"Default",
"/Bikes/{id}",
new { controller = "Bike", action = "Detail" }
);
But for SEO reasons we need to have urls like: /bikes/54/name-of-bike/kind-of-bike/number-of-wheels ... etc etc. But everything after id (54) can be ignored.
Does a...
Whenever I develop sites using Rails, I create a controller called "front" which has actions like "index," "how," and "about." So, the home page, "How It Works," and "About Us" pages can be accessed via /, /how/, and /about. My routes look like this:
map.root :controller => "front", :action => "index"
map.connect 'how', :controller => ...
I want to create a route something like:
http://images.example.com/[models]/[sizes]_[filename].[extension]
[models] = (blog|event|user)
[sizes] = (t|s|l|o)
[filename] = example
[extension] = (png|gif|jpg)
How do I create the route for this? I've tried the following w/ no success:
Router::connect('/:model/:size\_:filename.:extens...
I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the config/routes.rb defines the following
resources :users
match '/:controller(/:action(/:id))'
When I do a rake routes from the application that requires this gem I get the following routes
rake routes|grep users
users GET /users(...
Hi there,
Will keep this as simple a possible:-
I have a have a controller which will return either ViewA or ViewB - e.g.
[HttpPost]
public ActionResult ViewA(BlahModel model)
{
if (isTrue)
return View(model);
else
return View("ViewB", model);
}
...
The problem I have is that ViewB has a form on it. And what hap...
This is a month long thing I've been putting off, and I can't for the life of me figure this bugger out.
I'm tracking to access a file in website/admin/organizations/org_deals
My routes look like this :
map.namespace :admin do |admin|
admin.namespace :organizations do |organization|
organization.org_deals 'org_deals', :action =>...
Hi!
I'd like to have a URL like this:
/payroll/region/1
and I'd like it to map to the Tasks Controller's payroll_list function. I'd also like to use REST. What's the best way to do this?
Many thanks!
...
I have a route that currently looks like this:
map.resources :regions, :collection => {:select_for_payroll => :get}, has_one => :payroll
How can I make the :select_for_payroll take both GET and POST?
Many thanks!
MrM
...
Heyya guys.
So i thought about this coolio idea, if you are logged in then you get some sort of dashboard, else you get an information/login/sign up page.. So how do i do that..
I mostly wants to do this in Routes = not something like
def index
if current_user.present?
render :action => 'logged_in'
else
render :action => ...
I need to match /entries/slug-here/new and send it to EntriesController#new
Tried following ways, both didn't work :(
resources :entries do
member do
get :new
end
end
resources :entries do
get :new, :on => :member
end
Temporary hardcoded paths with bunch of matches, but it looks ugly >.<
UPDATED:
Same with create method ...
Hallo
I have a named route:
map.notes '/notes/:id/:from_date/:to_date', :controller => "users", :action => "notes", :defaults => { :from_date => nil, :to_date => nil }
When I create a path for this route in any other model or when using the route without the additional parameters (/notes/1) i get the expected url generated:
notes_pa...
I have a problem with routing with an id conditioned by a regex constraint.
My route is:
resources :albums, :constraints => { :id =>/[a-zA-Z\d\.\-\_]+$/ } do
get :offline, :on => :member
end
If I do this:
GET /content/v1/albums/:id(.:format) {:action=>"show", :controller=>"content/v1/albums", :id=>/[a-zA-Z\d\.\-\_]+$/
It w...
Hi,
I am quite new to Rails3, I basically created a subscribers scaffolding, I only want my app to respond to new and create actions.
So in config/routes.rb I defined:
resources :subscribers, :only => [:new, :create]
Which works this way
GET /subscribers => subscribers#new
POST /subscribers => subscribers#create
Now I want my a...
Hi.
Is it possible to set a Unicode string as a segment of a path in Rails?
I try the following:
# app/controllers/magazines_controller.rb
class MagazinesController < ApplicationController
def index
end
end
...