Questions tagged [routes]
Questions about mapping URLs to Controllers and Actions.
routes
33,485
questions
680
votes
31
answers
756k
views
How to detect a route change in Angular?
I am looking to detect a route change in my AppComponent.
Thereafter I will check the global user token to see if the user is logged in so that I can redirect the user if the user is not logged in.
399
votes
31
answers
142k
views
No route matches "/users/sign_out" devise rails 3
I've installed devise on my app and applied the following in my application.html.erb file:
<div id="user_nav">
<% if user_signed_in? %>
Signed in as <%= current_user.email %...
386
votes
10
answers
604k
views
Send data through routing paths in Angular
Is there anyway to send data as parameter with router.navigate?
I mean, something like this example, as you can see the route has a data parameter, but doing this it's not working:
this.router....
339
votes
18
answers
182k
views
S3 Static Website Hosting Route All Paths to Index.html
I am using S3 to host a javascript app that will use HTML5 pushStates. The problem is if the user bookmarks any of the URLs, it will not resolve to anything. What I need is the ability to take all url ...
256
votes
9
answers
424k
views
A potentially dangerous Request.Path value was detected from the client (*)
I am receiving the rather self explanatory error:
A potentially dangerous Request.Path value was detected from the client (*).
The issue is due to * in the request URL:
https://stackoverflow.com/...
249
votes
14
answers
230k
views
How can I find out the current route in Rails?
I need to know the current route in a filter in Rails. How can I find out what it is?
I'm doing REST resources, and see no named routes.
249
votes
13
answers
229k
views
How to get current route in Symfony 2?
How do I get the current route in Symfony 2?
For example, routing.yml:
somePage:
pattern: /page/
defaults: { _controller: "AcmeBundle:Test:index" }
How can I get this somePage value?
245
votes
8
answers
363k
views
How/when to use ng-click to call a route?
Suppose you are using routes:
// bootstrap
myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider.when('/home', {
templateUrl: ...
244
votes
10
answers
81k
views
Is it possible to make an ASP.NET MVC route based on a subdomain?
Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route? For example:
user1.domain.example goes to one place
user2.domain.example goes to another?
Or, can ...
230
votes
11
answers
402k
views
How to open a link in new tab using angular?
I have an angular 5 component that needs to open a link in new tab, I tried the following:
<a href="www.example.com" target="_blank">page link</a>
when I open the link, the application ...
230
votes
8
answers
214k
views
Angular 2 router no base href set
I am getting an error and can't find why. Here is the error:
EXCEPTION: Error during instantiation of LocationStrategy! (RouterOutlet -> Router -> Location -> LocationStrategy).
angular2....
216
votes
3
answers
173k
views
Failed to instantiate module [$injector:unpr] Unknown provider: $routeProvider
I received this error upon upgrading from AngularJS 1.0.7 to 1.2.0rc1.
207
votes
21
answers
636k
views
Next.js Redirect from / to another page
I'm new in Next.js and I'm wondering how to redirect from start page ( / ) to /hello-nextjs for example. Once user loads a page and after that determine if path === / redirect to /hello-nextjs
In ...
198
votes
14
answers
271k
views
Change route params without reloading in Angular 2
I'm making a real estate website using Angular 2, Google Maps, etc. and when a user changes the center of the map I perform a search to the API indicating the current position of the map as well as ...
195
votes
18
answers
265k
views
Passive Link in Angular 2 - <a href=""> equivalent
In Angular 1.x I can do the following to create a link which does basically nothing:
<a href="">My Link</a>
But the same tag navigates to the app base in Angular 2. What is the ...