similar to: Sessions in Layered Dispatching

Displaying 20 results from an estimated 1000 matches similar to: "Sessions in Layered Dispatching"

2006 Nov 04
1
layere dispatching - please help!
Hi Folks, I''m having trouble with setting up web services with layered dispatching. I''ve defined my controller (backend_controller.rb) as: class BackendController < ApplicationController web_service_dispatching_mode :layered web_service_scaffold :invoke web_service (:car) {CarService.new} end and my service (node_service.rb) as:
2007 Jan 18
2
How to use API from AWS -- help!
I''m building a users web service (direct dispatching) that will (I hope) allow several other applications to manage the same pool of users. Plus it will act as a single-sign-on solution for what I''m doing. But I''m having difficulty accessing the UserAPI. Here''s what I''ve done so far: $> rails usermanagement - "usermanagement" is the
2006 Mar 02
1
web serveces problem
Hi, I''m trying to added layered web services to my application and from some reason it''s not working for me. i''m working with ruby 1.84, rails 1.0. here are my files: 1. app/apis/kate_api.rb: class KateAPI < ActionWebService::API::Base inflect_names false api_method :check_version, :expects => [:string], :returns => [:string] end 2.
2006 Apr 21
8
web services and dealing with before_filter
Hi all, I''ve got a Rails app with a ApplicationController that looks like this: class ApplicationController < ActionController::Base before_filter :authorize, :except => :login def authorize unless session[:user] flash[:notice] = "Please log in" session[:jumpto] = request.parameters redirect_to :controller =>
2006 Jan 06
6
AWS and array of Model
Hi! I try to use a layered webservice and I want to get back an array of users; In the API I use: api_method :listUsers,:returns=>[[User]] in the service: def listUsers User.find(:all) end Result in soap mode: Don''t know how to cast TrueClass to Object Result in XML-RPC mode: You have a nil object when you didn''t expect it! You might have expected
2006 Jan 04
5
Webservice External XMLRPC
Hello i have some trouble getting my webservice to run . I have the following webservice : class DirectSpoolAPI < ActionWebService::API::Base api_method :add, :expects => [{:html=>:string},{:from=>:string}], :returns => [Customer] end class DirectSpoolService < ActionWebService::Base web_service_api DirectSpoolAPI def add(html,from) Customer.find(:first) end
2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
Hello. I hope this is the right place to describe my problem ? After upgrading to Rails version 1.1.2 from rails version 1.0.0, Web Service functional tests seem broken. I upgraded rails (as the root user / administrator) with: # gem update rails --include-dependencies then I upgraded my application (as myself) with: ? rake rails:update % rake rails:update:configs After these steps,
2008 Jan 21
7
undefined method error
Hello everyone, I am following the Practical Rails: Social Networking sites book. In chapter 7 photo gallery I am getting a NoMethodError in Pages#show Showing layouts/_menu.rhtml where line #12 raised: undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c> Extracted source (around line #12): 9: <% if is_logged_in? %> 10:
2009 Apr 29
7
problem with nil.user
Hi all, I''ve put new code into my app so that an administrator will have extra privileges (administer users, edit pages). The error is: ''Couldn''t find User without an ID'' So the app is looking for a logged in user when the homepage is accessed. Heres my code: site/index view: <% if is_logged_in? and logged_in_user.has_role?(''Moderator'')
2009 Jun 05
6
rails 2.3.2
Hi all, I am using rails v.2.3.2 and if I put following line to my ApplicationController: include LoginSystem and I moved my login_system.rb to lib folder: module LoginSystem protected def is_logged_in? @logged_in_user = User.find(session[:user]) if session[:user] end def logged_in_user return @logged_in_user if is_logged_in? end def logged_in_user=(user) if
2006 Jul 27
2
setting initial text field values in a form
Hi, I am trying to create a basic form in which I want one of the fields initialized before displaying it. My code (in a view) is as follows: <% if ( session[:user_id] != nil ) then logged_in_user = User.find(session[:user_id]) end %> <% form_for :suggestion do |form| %> <label for="suggestion_title">Topic:</label><br/> <%=
2006 Jun 06
5
Functional tests and protected actions
Hello! I have certain methods in my Application Controller, that I need to access. Namely ApplicationController#logged_in_user The problem is, that when I try to access it, I get: NoMethodError: protected method `logged_in_user'' called for #<AdminController> Any ideas how I can circumvent that? Or are functional tests really not suited for any kind of logins and session work?
2006 Mar 02
8
User Authentication
I''m trying to create a simple authentication system but am failing miserably. I''m (sort of) following the "Logging In" chapter of the Agile book. Ideally, any access to http://example.com/publish (and any of its subdirectories) should redirect to http:/example.com/publish/login when there is no valid session user_id. Code so far:
2007 Jun 05
1
undefined method <name> for Service:Module
Hi all, We have a controller by name "ServiceController" (service_controller.rb) and everything was fine until we upgraded our rails. We recently upgraded Rails from Rails 1.1.6 to Rails 1.2.3. and after that when we try to invoke the "ServiceController" we are getting an error like this "undefined method find for Service:Module" I guess some namespace collision is
2009 Feb 25
3
Secure but elegant destruction method
Hi,- I am looking for a clean and secure way for an ActiveRecord instance to delete itself. Say I have a User model in my app. Then the destructive action would be /users/user_id/destroy. If this action is not secured by a filter like: (*) before_filter :check_administrator_role, :only => :destroy then any user could potentially log in and start issuing: /users/1/destroy /users/2/destroy .
2009 Aug 25
5
uninitialized constant
API-> hello_message_api.rb. class HelloMessageApi < ActionWebService::API::Base api_method :hello_message, :expects => [{:firstname=>:string}, {:lastname=>:string}], :returns => [:string] end controller -> class HelloMessageController < ApplicationController web_service_api HelloMessageApi web_service_dispatching_mode :direct wsdl_service_name
2008 Jun 04
12
Mongrel as Windows service with normal privileges
I am trying to run Mongrel 1.1.5 with mongrel_service 0.3.4 on Ruby 1.8.6 with a "normal" user account, i.e. a user which belongs only to the Windows group "Users". The rationale behind this is that running a web server with full administrative rights (e.g. Local System) is not something that I would like to do. Unfortunately, starting the service from the services control
2006 Nov 21
2
before_filter in actionwebservice controller using direct dispatching
The docs say that for direct dispatching mode to use controller filters, but when the controller is run I get the following error. The authorize method is in application.rb. Works fine when it''s not a web service api. Should I be using before_invocation instead even with direct dispatching mode? Or can I not have the authorize method in application.rb? undefined method
2006 Jan 01
4
Agile book deltas
Are there deltas for the revisions of the PDF version of the Agile book? -- fxn
2006 Mar 16
4
Handling/Catching Exceptions
Hello! I was wondering, sometimes I raise an exception in my Rails apps, e.g.: raise SecurityError unless @post.user == logged_in_user Now: is there any way to catch that SecurityError exception somewhere and render a custom template? E.g., I want to render ''app/views/content/security_error.rhtml'' Does anyone know how to do this? Thanks a bunch, Rob