Questions tagged [named-routing]

50 questions
1
vote
2 answers

How to filter list action in Rails using named routes?

Given I have two models: company and location. A company has many locations. I found Ryan Bates' Named Routes very interesting. So I added resources for each of my model in routes.rb. resources :companies resources :locations This enables me to…
JJD
  • 50,076
  • 60
  • 203
  • 339
1
vote
1 answer

Rails 3 Routes: Named routes. "No route matches"

So I'm getting a 'No route matches' error, and being new to Rails 3 (and Rails in general), I really don't know what the problem is. Here are the pertinent routes: resources :users #... match 'reset_password(/:reset_password_code)' =>…
Groovetrain
  • 3,315
  • 19
  • 23
1
vote
0 answers

Angular2 named router outlet with lazy loaded routes

My main routing is like this: export const routes = [ { path: "", component: SiteLayoutComponent, //canActivate: [AuthGuard], children: [ { path: "", redirectTo: "/routeA", pathMatch: "full" }, ...... ...... …
jones
  • 1,423
  • 3
  • 35
  • 76
1
vote
0 answers

Angular 2, Error: Cannot match any routes using named router outlet and [routerLink] inside of named outlet

I have a minimal Plnkr here: Named Router Outlet Example This link works outside of the router, but the same link fails if it is inside of a component inside of the named router outlet: Al…
1
vote
2 answers

NotFoundHttpException named route PHP Laravel 5.2

Route::get('user/profile', function () { return 'test' })->name('profile'); But I always get error when I call the address/profile if i use address/user/profile it works just fine. The error list shown in my browser : NotFoundHttpException in…
user3859812
  • 11
  • 1
  • 6
1
vote
1 answer

How do I specify that a named route should use a model's columns its _url and _path functions?

I have a Posts model with id and title columns. I've got my route (rails 2.3.8) set up as follows: map.post ':title/:id', :controller => 'posts', :action => 'show' which works correctly when recognising URLs and when generating them explicitly, as…
Simon
  • 25,468
  • 44
  • 152
  • 266
1
vote
1 answer

How to map a resource to more than one helper in rails?

I have a Profile model, which is inherited by a Customer and Vendor model. Profile has_many :posts. When I do form_for [ @profile, @post ] do |f| Instead of callind profile_posts_path, form_for will actually call customer_posts_path or…
Francesco Boffa
  • 1,402
  • 1
  • 19
  • 35
0
votes
1 answer

Rails named routes for the show action

In my app I assign a url's href attribute as profile_path when using resources :profiles in my routes.rb file. I do not pass any id into profile_path yet the app somehow correctly assumes that it is the profile of the current_user. How does rails…
Justin Meltzer
  • 13,318
  • 32
  • 117
  • 182
0
votes
2 answers

Rendering rails named route

How do I render a rails named route properly from controller? routes.rb: get "logout" => "sessions#destroy", :as => "logout" get "login" => "sessions#new", :as => "login" get "signup" => "users#new", :as => "signup" root :to =>…
GTDev
  • 5,488
  • 9
  • 49
  • 84
0
votes
0 answers

cannot route to named outlet Angular 10

I have an app, the app has a router for the main part of the page and another router for a chat. In my app.routing: const routes: Routes = [ { path: 'start', canActivate: [AuthGuard], loadChildren: () => …
0
votes
2 answers

How to pass named routes of main to BottomNavigationBar in other class flutter?

My main.dart screen calls SplashScreen and then SplashScreen calls BottomNavigationScreen. I am manually calling all the screens for _widgetOptions.elementAt(_selectedIndex) in widgetOptions. I want not to call all screens manually. Instead I want…
0
votes
2 answers

Laravel 404 Error with parameter but without parameter it is working

Route::prefix('admin')->group(function () { Route::get('/editcategory/{$id}', [CategoryContoller::class, 'edit'])->whereNumber('id')->name('editcategory'); }); This Code gives me a 404 Not Found. But without parameter page is showing.
TechRian
  • 3
  • 2
0
votes
1 answer

Route [people.comments] not defined

help me to find the problem, the laravel project gives error before loading Route [people.comments] not defined I copied and pasted the route name, copied and pasted the working routes, but no, it doesn't work. Route::post('/people/comments',…
Hyzyr
  • 568
  • 4
  • 13
0
votes
0 answers

Symfony\Component\Routing\Exception\RouteNotFoundException

The error Symfony\Component\Routing\Exception\RouteNotFoundException pops up, Yet, I do have this named route... /* ADMIN SECTION */ Route::prefix('admin')->name('admin/')->group(function () { Route::group(['middleware' => ['auth']],…
M.Koops
  • 145
  • 1
  • 15
0
votes
2 answers

Route not defined when passing parameter to a route

I have a named route with a parameter which looks like this... Route::get('/profile/{user_id}', [ProfileController::class, 'profile'])->name('profile'); Now in one of my controller, I have a function that calls this route like this public function…
modi
  • 297
  • 2
  • 3
  • 15