routing

Angular rc3 router - Navigating to same page with different parameters

末鹿安然 提交于 2019-12-10 02:32:07
问题 I'm currently trying to navigate to the same page with different id values. So if i am on /test/1 and go to /test/2 the url in the browser updates but the view does not refresh. I debugged ngOnInit and it did not rerun when navigating to /test/2 . However if I go from test/1 to other the routing works fine, the issue only occurs when navigating to the same route with different parameters. Has anyone else come across this? When I get some time ill upload a plunkr. Angular 2 rc3 router 3.0.0

NoRouteToHostException on client or server?

痴心易碎 提交于 2019-12-10 02:06:31
问题 I am getting Caused by: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect

Rails Routing Broken In Production - Caching of routes.rb suspected

和自甴很熟 提交于 2019-12-10 00:58:48
问题 Update: Turns out that this problem was because half my mongrel did not restart. Thanks all for help! Hi folks, i have an urgent problem. Essentially, my routing works on my localhost. But when i deployed this to production, the routes does not seem to work correctly. For example, given a new route "/invites" - sometimes i will get a 404, and sometimes it will work correctly. I suspect there is some caching going on somewhere, but i am not sure. Logs: when a page is not found (when the routes

How to embed multiple tags in Rails routes, like Stack Overflow

荒凉一梦 提交于 2019-12-10 00:32:19
问题 When one selects a tag on Stack Overflow, it is added to the end of the URL. Add a second tag and it is added to the end of the URL after the first Tag, with a + delimiter. For example: http://stackoverflow.com/questions/tagged/ruby-on-rails+best-practices How is this implemented? Is this a routing enhancement or some logic contained in the TagsController ? Finally, how does one 'extract' these tags for filtering (assuming that they are not in the params[] array)? 回答1: Vojto's answer is

On query parameters change, route is not updating

百般思念 提交于 2019-12-09 21:07:01
问题 In my application, there are multiple links in which I have some links with the same route but with different query parameters . say, I have links like: .../deposits-withdrawals .../deposits-withdrawals?id=1 .../deposits-withdrawals?id=2&num=12321344 When I am in one of the above routes and native to the other route from above mentioned, the route is not changing. Not even any of the functions like ngOnInit or ngOnChanges being called.I have changed the parameters from queryParameters to

Comparing route to current request in Symfony

心不动则不痛 提交于 2019-12-09 19:31:15
问题 For my site navigation I'd like to indicate the current page. If each page in the navigation has its own route is there a way to see if the current request matches the route? Something like: $request->getRoute() == '@my_route' Or, more generally, is there an idiomatic way of setting the active page when creating site navigation in Symfony? 回答1: Or, more generally, is there an idiomatic way of setting the active page when creating site navigation in Symfony? Don't use sfContext::getInstance(),

How can configure linux routing to send packets out one interface, over a bridge and into another interface on the same box

拥有回忆 提交于 2019-12-09 19:29:40
问题 I'm trying to test a ethernet bridging device. I have multiple ethernet ports on a linux box. I would like to send packets out one interface, say eth0 with IP 192.168.1.1, to another interface, say eth1 with IP 192.168.1.2, on the same subnet. I realize that normally you don't configure two interfaces on the same subnet, and if you do the kernel routes directly to each interface, rather than over the wire. How can I override this behavior, so that traffic to 192.168.1.2 goes out the 192.168.1

Default :exclude option for Rails resource routing

a 夏天 提交于 2019-12-09 18:29:57
问题 A minor question: I am using Rails for my REST API, but since it is a RESTful API I don't really need :new or :edit routes for any of my resources since people will only be interacting with this API entirely through automated JSON requests, not graphically. There's no need for a dedicated edit page, for instance. Currently, I need to do something like this for every resource defined: # routes.rb resources :people, except: [:new, :edit] It's not a big deal to have :except options on every

.NET MVC Routing w/ Url Encoding Problems

别说谁变了你拦得住时间么 提交于 2019-12-09 16:13:43
问题 I have the following routing code: routes.MapRoute( "email-validated/{sessionId}", "email-validated/{sessionId}", new { controller = "User", action = "EmailValidated", sessionId = UrlParameter.Optional } ); When I hit the route w/ something that is url encoded it won't match the route for %2f, %2b and some other escaped characters. It also won't match for non url encoded (things w/ + etc) For instance This works: email-validated/XQiKC6KMM

What is the opposite of url_for in Rails? A function that takes a path and generates the interpreted route?

可紊 提交于 2019-12-09 16:09:59
问题 Brain's a little fried....How do I get a hash of the :controller and :action from a relative_path? This is basically the opposite of url_for. in the example below, "some_function" is the mystery function name I'm looking for...I know it's easy, just can't remember or seem to be able to find it in the docs. Like so: some_function('/posts/1/edit') => {:controller => 'posts', :action => 'edit', :id => '1'} 回答1: Rspec has a method 'params_for', which uses Action Controller's Routing Methods to