routes

change CakePhp1.3 paginator destination url?

◇◆丶佛笑我妖孽 提交于 2019-12-25 16:54:14
问题 I'm new to cakephp...and I have a page with a url this: http://localhost/books/filteredByAuthor/John-Doe so the controller is ´books´, the action is ´filteredByAuthor´ and ´John-Doe´ is a parameter.. but the url looks ugly so i've added a Route like this: Router::connect('/author/:name', array( 'controller' => 'books','action' => 'filteredByAuthor'), array('pass'=>array('name'),'name'=>".*")); and now my link is: http://localhost/author/John-Doe the problem is that the view has a paginator

jRuby deployment into a subfolder in Tomcat

感情迁移 提交于 2019-12-25 16:47:35
问题 While developing a jRuby application using webbrick as the webserver, all my code is written with http://localhost:3000 as the root. When deploying to Tomcat, I create a WAR file and it creates a subfolder under the webapps/ folder: localhost:8080/project_name/ This causes a load of problems with my code. Is there anything I can do in my ruby routes.rb file to deal with this? Should I resort to using some sort of virtual host in Tomcat? 回答1: There is code in JRuby-Rack to deal with this.

Ember.js controller variables reseting after page refresh

浪尽此生 提交于 2019-12-25 14:40:03
问题 Using Ember.js: I have a Route App.QueryDataRoute = Ember.Route.extend({ model: function(params) { return Ember.RSVP.hash({ propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title), nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"), deal: this.controllerFor("queryData").get("deal"), price: this.controllerFor("queryData").get("price"), surface: this.controllerFor("queryData").get("surface"), }); } }); All those .get(' [variable name] '

Ember.js controller variables reseting after page refresh

时光毁灭记忆、已成空白 提交于 2019-12-25 14:39:54
问题 Using Ember.js: I have a Route App.QueryDataRoute = Ember.Route.extend({ model: function(params) { return Ember.RSVP.hash({ propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title), nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"), deal: this.controllerFor("queryData").get("deal"), price: this.controllerFor("queryData").get("price"), surface: this.controllerFor("queryData").get("surface"), }); } }); All those .get(' [variable name] '

AngularJs route authentication

做~自己de王妃 提交于 2019-12-25 14:05:50
问题 The problem is that I would like to restrict access to specific routes and show login page if user does not have valid JWT. I just wanna tell that I'm very new in AngularJs and NodeJs. So in short I have LoginCtrl: $scope.login = function(username, password){ UserSvc.login(username, password) .then(function(response){ $scope.$emit('login', response.data ); $window.location.href = '#/'; }, function(resp){ $scope.loginError = resp.data.errors; }); } I rise an event, in ApplicationCtrl the event

AngularJs route authentication

烂漫一生 提交于 2019-12-25 14:04:17
问题 The problem is that I would like to restrict access to specific routes and show login page if user does not have valid JWT. I just wanna tell that I'm very new in AngularJs and NodeJs. So in short I have LoginCtrl: $scope.login = function(username, password){ UserSvc.login(username, password) .then(function(response){ $scope.$emit('login', response.data ); $window.location.href = '#/'; }, function(resp){ $scope.loginError = resp.data.errors; }); } I rise an event, in ApplicationCtrl the event

Codeigniter routes not working sometimes

佐手、 提交于 2019-12-25 12:43:16
问题 I have a little question. I am using Codeigniter 2.1.0 and I have the following code in my routes.php. $route['default_controller'] = "photo"; $route['404_override'] = 'error'; $route['photo/:num'] = 'photo/index/$1'; $route['people/:num'] = 'people/index/$1'; The weird thing is, sometimes when I go to http://www.myurl.com/photo/1 it works and othertimes it redirects me to my error page. Anyone maby has any idea what is wrong with my routes ? Already thanks in advance! Bob 回答1: This is not

helper path generated by Rails based on a custom REST method fails

别来无恙 提交于 2019-12-25 10:55:48
问题 wanted to define custom routes into certain resources in addition to the ones Rails defines by default. To do this, the relevant parts of my routes.rb file look something like this: resource :top, only: [:show] scope module: :top do resource :reso, only: [:show] end get 'foo_reso' => 'top/reso#foo' get 'bar_reso' => 'top/reso#bar' As you can see, I only want routes to ResoController 's methods show , foo , and bar . This works, as rake routes gives: reso GET /reso(.:format) top/reso#show foo

Laravel route not defined error

天大地大妈咪最大 提交于 2019-12-25 09:25:46
问题 I keep getting route not defined error and if I use url() I get server can not provide a secure connection error. I hope I can get some help. route Route::get('/show/{table_name}/{product_id}', 'PageCotroller@showdetails')->name('product-show'); View: <h4><a href="{{ url('product-show' .$table_name . '/' .$product->item_id)}}">{{ $product->title }}</a></h4> Controller: public function showdetails($table_name,$pid){ $categories = Category::all(); $data['product_id']=$pid; $data['table']=$table

ruby rails - undefined local variable or method `new_user_session_path'

陌路散爱 提交于 2019-12-25 08:55:35
问题 Running Rails 3. Included "include Rails.application.routes.url_helpers" in model file of users. Still getting this error. Any idea?? # cat app/models/user.rb class User < ActiveRecord::Base include Rails.application.routes.url_helpers acts_as_authentic end # rake routes users GET /users(.:format) users#index POST /users(.:format) users#create new_user GET /users/new(.:format) users#new edit_user GET /users/:id/edit(.:format) users#edit user GET /users/:id(.:format) users#show PUT /users/:id(