routing

Is it i possible to prevent certain PartialViews from being served if requested directly?

扶醉桌前 提交于 2019-12-02 09:46:24
I'm working on a site that has routes to actions which render Partial Views. A lot of these partial views are components which together make up a complete page. For instance on a search page I'm working on has a text box, a list of tabs, and a Table. Seach of these can be accessed with a URL similar to /Search/SearchPanel /Search/Tabs/{SearchTerm} /Search/ResultsTable/SearchTerm?tab=[currently selected tab] and these are all rendered on with a RenderPartial on my Index page. When the page loads, it will display each of these components the way I want it. But at the moment there's nothing

RoutingError inside an iFrame

坚强是说给别人听的谎言 提交于 2019-12-02 09:42:41
I scaffolded a test app and got a Routing error when I put an iFrame inside my view: This is the show template where I added the iFrame: views/bars/show.html.erb: <p> <b>Body:</b> <%=h @bar.body %> </p> <iframe src=“http://www.yahoo.com” style=“width:500px; height:500px;” frameborder=“0?></iframe> <%= link_to 'Edit', edit_bar_path(@bar) %> | <%= link_to 'Back', bars_path %> I'm calling the page like this: http://localhost:3000/bars/1 The page displays correctly. But the iFrame inside the page says this: Routing Error No route matches "/bars/%E2%80%9Chttp://www.yahoo.com%E2%80%9D" with {:method

Linux : how to set default route from C?

给你一囗甜甜゛ 提交于 2019-12-02 09:22:17
问题 How can I set (and replace the existing) default network route from a C program? I'd like to do it without shell commands if possible (this is a low memory embedded system). Also can you set the default route without specifying the gateway IP address? In my application I want to make either ppp0 or eth0 the default route, depending on whether the cable is plugged into eth0 or not. Thanks, Fred 回答1: You could strace the route command you are wanting to mimic. This gives you the relevant

Routing: Datetime parameter passing as null/empty

别等时光非礼了梦想. 提交于 2019-12-02 09:18:19
The problem: Two attributes are needed for a Controller. However, one of them ( datetime ) goes as null. Routing A new routing was incorporated so the Controller could receive two attributes: app.UseMvc(routes => { routes.MapRoute( "RequestHistorial", "HechosLiquidadors/Details/{id:int}/{date:datetime}", defaults: new { controller = "HechosLiquidadors", action = "Details" }); routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); The datetime parameter doesn't have a format restriction or anything. How the data is sent This is the view that sends the

Rails: Routing without plurals gives strange helpers

只愿长相守 提交于 2019-12-02 08:55:29
I am getting a strange named helpers with this setup: In config/routes.rb I have: Qtl::Application.routes.draw do resources :qtl_table do collection do get 'search' end end ... end rake routes outputs this: search_qtl_table_index GET /qtl_table/search(.:format) {:action=>"search", :controller=>"qtl_table"} qtl_table_index GET /qtl_table(.:format) {:action=>"index", :controller=>"qtl_table"} POST /qtl_table(.:format) {:action=>"create", :controller=>"qtl_table"} new_qtl_table GET /qtl_table/new(.:format) {:action=>"new", :controller=>"qtl_table"} edit_qtl_table GET /qtl_table/:id/edit(.:format)

Understanding usage of symbols in routes.rb files

你。 提交于 2019-12-02 08:52:20
问题 I am newbie to ruby, and I am working on a project. In the routes.rb file, and there is some syntax I don't understand. More precisely, I can find in this file alternatively : get :account #with a symbol get 'notes' #with no symbol What is the difference ? I suppose :account should be defined elsewhere, sooner in the routing process, right ? 回答1: get :account (using symbol) and get 'account' (using string) are exactly the same in this context. In your route the symbol will be translated to a

Can i hide controller and view name cake php 2?

戏子无情 提交于 2019-12-02 08:38:38
问题 I am using cake php and due to some reason i want to hide controller and action name from the url . current url us like http://192.168.1.31/home/this_is_test where home is controller name and this_is_test is slug which is dynamic . i want the url like http://192.168.1.31/this_is_test. my routes.php is Router::connect('/', array('controller' => 'home', 'action' => 'index')); Router::connect('/dashboard', array('controller' => 'dashboard', 'action' => 'index')); Router::connect('/login', array(

Sniffing IGMP messages on the local network

旧巷老猫 提交于 2019-12-02 08:21:30
I'm trying to sniff all IGMP messages on the local network (for crazy reasons not to be discussed ;-)). I have some questions related to this, as I'm not really an IGMP/routing expert. Is it even possible? I know I can read IGMP from a raw socket, and I know you can use Wireshark to monitor the IGMP messages that reach your local computer, but what puzzles me is this: I use a program on another computer (separated from the one running Wireshark by a switch) which will join a multicast address - BUT - it's not always that I even see the Membership report/JOIN in Wireshark. Now does anyone know

matching URL parameter spanning multiple “/” in ASP.NET MVC

核能气质少年 提交于 2019-12-02 07:58:52
问题 What is the best way to match URL parameter spanning multiple "/" in ASP.NET MVC ? Eg URL: http://example.com/controller/action/p1/p2/p3/p4 I want to pass just one parameter to the action method (above, it is "p1/p2/p3/p4"). Here, the parameter may have arbitrary number of subitems ( p1/.../pn ). What is the best way to accomplish this? Any way to get this implemented using pure MVC routing? 回答1: If i understand it clearly you want to make it this way routes.MapRoute(null, "{controller}/

PHP Routing - stylesheets have no effect

℡╲_俬逩灬. 提交于 2019-12-02 07:40:53
I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param). So in my index.php I've defined a div for header, content and footer, and the /page/ determines which file to include in the content-div. The routing works, and the HTML is loaded, but the stylesheet doesn't seem to be. Neither does it work when I <link> the stylesheet directly in the file (and supposedly it's possible to link a stylesheet within the body, with the attribude itemprop rather than rel ) - anyways, does anyone