routing

How to redirect users to a custom web page each time `params` contain a `redirect_uri` value?

穿精又带淫゛_ 提交于 2019-12-24 15:07:07
问题 I am running Ruby on Rails 4.1 and I would like to implement a feature that redirects users to a custom web page when they perform an action by providing a redirect_uri parameter. In other words, I would like to "trigger" the redirection each time the redirect_uri value is present in params and the redirection should happen in any case (e.g., when GET, POST, PUT and DELETE HTTP requests are executed with HTML or JS formats) after the process flow has been fully accomplished (e.g., when the

Ruby on Rails: How to assign a hard value to a variable?

亡梦爱人 提交于 2019-12-24 14:53:18
问题 I am using multiple redirects, and I would like to redirect from A->B->C->A. So in B, I save path A as @previouspage = request.referer and so @previouspage = A at this point, but when I call @previouspage in C, it doesn't bring the hard value saved in B, but finds its own relative request.referer, which is B. So in C, @previouspage = B (because I think variables in Ruby are soft-links) How would I just save whatever the value of request.referer was at point B, and then save that URL into a

Consolidating messy routes in Rails 4. How to organize routes to not point urls to static links?

◇◆丶佛笑我妖孽 提交于 2019-12-24 13:31:16
问题 Here comes a rails nub organizational question: What exists: A "Railsy" link would look something like this (in slim) span a href= signout_path signout_path correspond to AuthController#signout . So, in my applications there's several types of users - Firefighters, Chiefs and Captains. Each one has very similar routes: /dashboard /dashboard/:date ( this is in case they want to see a previous date; same dashboard, different data in the controller ) /account /account/update /entry/view /entry

How to pause the route change in navigationStart router event

霸气de小男生 提交于 2019-12-24 10:59:57
问题 In my application I have routes exposed from packages (node modules). So i couldn't use canActivate or canDeactivate for the routes defined inside node modules. So I started subscribing to all route change in my app component and based on condition i am redirecting the user to different routes. Since the condition has API call, the route change is not paused in the navigationStart instead it completes the routing to other page and once API call is successful the redirect happens to the other

Rails 5 - Create vanity route for each instance of model

萝らか妹 提交于 2019-12-24 10:17:09
问题 I know there has to be a cleaner way of doing this but I haven't written code in a while and am drawing a blank. I have a model called Link that has a Title, Slug and Destination. Destination is the location to redirect (mydomain.com/instagram would redirect to my instagram account). Slug is to customize the slug for friendly_id. This is the code in my routes.rb and it works but it feels gross. Link.all.each do |link| get "/#{link.slug}", to: 'links#show', :id -> link.id end Is there a better

symfony 3.3 custom router

拥有回忆 提交于 2019-12-24 09:28:29
问题 I have an application, which is dual accessible through login and an OAuth client secret with the same routes. For Oauth access I need to pass a url parameter: "access_token" around on all urls. It seems best to achieve this with a custom router: app/config/services.yml # Learn more about services, parameters and containers at # https://symfony.com/doc/current/service_container.html parameters: router.class: AppBundle\Routing\AccessTokenRouter services: # default configuration for services in

Yii2 routing with get parameters only ( hidden controller and action )

夙愿已清 提交于 2019-12-24 08:57:48
问题 I saw routing where the controller and the action are hidden and url is constructed like www.domain.com/en/page-33/category-28/product-89?param=some_param . In this routing when I try to get the parameters with var_dump(Yii::$app->getRequest()->getQueryParams()) I got array like so : array(4) { ["first_step"]=> string(7) "page-33" ["second_step"]=> string(11) "category-28" ['product']=> string(10) "product-89" ['param']=> string(10) "some_param"} How can I do that ? I saw the rules and they

CakePHP 2.x Custom Route Pagination

£可爱£侵袭症+ 提交于 2019-12-24 08:34:47
问题 I have a the following custom route (which works fine): Router::connect('/:city', array('controller' => 'dealers', 'action' => 'index'), array('city' => '[a-z]+')); With this route, I am trying to get paginated pages 2, 3, …: Router::connect('/:city/:id', array('controller' => 'dealers', 'action' => 'index'), array( 'pass' => array('city', 'id'), 'city' => '[a-z]+', 'id' => '[0-9]+' ) ); The first problem now is, that if I enter domain.com/washington/2 it doesn't pass the id to Pagination and

ASP.net “{Controller}/” returning 403.14 error

感情迁移 提交于 2019-12-24 08:29:47
问题 I am having a curious issue with one of my projects in development. The issue is with links to a certain URL "//localhost:62168/Images/Index". I have buttons linking to that URL but when "//localhost:62168/Images/" is accessed it returns a HTTP Error 403.14 - Forbidden error. See the below Image: localhost//Images/ Oddly enough though, when I enter the URL exactly ("localhost:62168/Images/Index") it loads the page properly. See the below Image: localhost/Images/Index I've done plenty of

how to write route for multiple parameters in url in laravel?

爷,独闯天下 提交于 2019-12-24 08:25:50
问题 I want to pass two parameters in url. My url is http://localhost/buyforfund/fundraising/public/campaign_details/64 I want this url : http://localhost/buyforfund/fundraising/public/campaign_details/64/campaign_product_details/26 on button click I want this url and I give the button link from route name. But an error occurs. button link: <a href="{{ route('campaign_product_details.detail',$result->id) }}" class="hvr-float-shadow">View</a> Error: Missing required parameters for [Route: campaign