search for: my_control

Displaying 20 results from an estimated 44 matches for "my_control".

Did you mean: mp_control
2006 Jan 16
3
routing to controller inside module
Hey, am i to stupid to find the information about how to route to a controller in a module? Maybe module support has gone! The controller is under: app/controllers/admin/my_controller.rb The my_controller.rb file looks like this: module Admin class MyController def index render :text => ''Hello!'' end end end How does a route to all controllers under module Admin look like? map.connect ''admin/:controller/:action/:id'', :...
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the...
2006 May 11
1
skipping filters
...any controller as a before_filter. All is good, except I''m having trouble figuring out how to make the public login actions skip this before filter. Here''s what I have: application.rb skip_before_filter :requires_login, :only => [:login, :logout, :confirm_valid_login] my_controller.rb before_filter :requires_login, :except => [:list, :show] I can''t successfully pass authentication and what I believe is happening is that all the right things are happening up till the point of my_controller.rb, where the :except tells Rails to add all the actions from ap...
2006 May 09
1
Reusing a model to form and link_to.
Hy guys, Inside my app I have a form which contains user information. Sometimes a have a form with a text_field as above: <%= form_remote_tag(:html => { :action => url_for(:controller => "my_controller", :action => "my_action") }) %> <%= text_field(''my_object'', ''my_parameter'', :maxlength => ''30'' )%> <%= submit_tag "Send"%> <%= end_form_tag %> In the controller I retrive the in...
2006 Aug 10
1
Web service SOAP URLs started failing with 1.1.4 or using 1.1.2 security patch
...o my Web service URLs work with Rails 1.1.2 but fail both with Rails 1.1.4 (and 1.1.5) and when I apply the new 1.1.2 security patch to Rails 1.1.2. It looks like they are failing with SOAP clients but succeeding with XML-RPC clients. The URL that used to work is of the form http://localhost:3000/my_controller/ServiceName/api. When I use that same URL after applying the 1.1.2 security patch (or in 1.1.4/1.1.5), my application sees a 404 error. The WSDL url http://localhost:3000/my_controller/ServiceName/service.wsdl also fails. When I try to go to that URL in my browser, I see Recognition fa...
2010 Jan 31
3
Append/Prepend to a template from controller method
...ng="en"> <head> <%= yield :refresh_tag %> </head> <body> <%= yield %> </body> </html> So then if I want to add a redirect-after-delay, I add the following to 1) my controller and 2) the action''s view: app/controllers/my_controller.rb def my_action redirect_after_delay ''http://www.google.com'', 3 if some_condition end app/views/my_controller/my_action.html.erb <% content_for :refresh_tag do %> <meta http-equiv=''refresh'' content=''<%=@redirect_delay%>;url=<...
2006 Apr 08
2
Cannot use view helpers in RJS helpers
Any ideas why I would get an error in a RJS helper on view helpers such as number_to_currency. Example: # my_template.rjs page.help_me # my_helper for my_controller def help_me number_to_currency(10) end I have also tired page.number_to_currency but that doesn''t work either. Cheers, Nicholas
2007 Apr 01
2
"-" instead of "_" in routes?
Hi all I''d like to have minus signs "-" instead of underscores "_" in my routes. Is there an easy to do that? my_controller/show_something/123 # <= not cool my-controller/show-something/123 # <= much cooler Thanks a lot Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on R...
2006 Apr 28
10
Sharing RJS Templates
Hello All, I''m enjoying the simplicity and power of RJS templates in Rails 1.1, but am perplexed about sharing them. I have several templates that I would like to access in various controllers, but if I moved them to views/shared/whatever.rjs, my app can''t seem to find them. I changed the name to _whatever.rjs and referenced them as "shared/whatever", but no luck.
2006 Dec 29
4
Remote API passing in parameter named 'action', routing loses it
I''m working with a remote API that calls a URL in my app, passing in a parameter named action. So the request would look like: http://localhost/my_controller?action=foo Routing correctly interprets the controller action as index. However, it sets params[:action] to index as well. I know that''s how it''s supposed to work...but it means I lose the action parameter passed in. What''s the easiest way to get the action paramet...
2010 Jun 03
7
Scheduled tasks in Rails: Cron + wget = Best solution?
...My additional question is: How would the cron job entry have to look like in order to let cron "log in" (as admin for example) before calling the action (for obvious security reasons)? This is what I have until now: 20 * * * * /usr/bin/wget --quiet -O - ''http://www.mydomain.com/my_controller/my_action'' Thank you for opinion and/or hints! Tom -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3Mboc...
2007 Apr 05
3
Extending assigns in controller specs?
Hello, I am interested in enhancing assigns in controller specs to do things like the following assigns[:key1, :key2, :key3] #=> vals for keys Is there away to "break open" this construction to overload the :[] operator? Thanks. -Chris
2006 Jun 07
3
Getting values
What if I have this URL on my browser''s address bar? http://www.mysite.com/controller/rhtml/3 How can I put the "3" as a value inside the controller. Thanks, Jeremy -- Posted via http://www.ruby-forum.com/.
2005 Dec 18
2
Default routes for unknown actions
...' routes: map.connect ''*anything'', :controller => ''welcome'', :action => ''unknown'' Which works just fine for a URL like: "mysite.com/junkjunkjunk" However, it still tries to resolve an action when I do: "mysite.com/my_controller/junkjunkjunk" How can I send Rails to a default route in the case of an unknown action? Currently, I get the standard "Unknown action... No action responded to junkjunkjunk" Jake -- Posted via http://www.ruby-forum.com/.
2006 Aug 06
0
Can I strip a file suffix off a URL with routing?
I would like a route that strips of the suffix of a url before determining the action. Eg: http://mydomain.com/my_controller/my_action.pdf Would map to: { :controller => ''my_controller'', :action => ''my_action'' } Is this possible? Thanks, -Jonathan.
2006 Jul 19
1
A couple of problems
...y a DRb::DRbUknown object and therefore cannot be accessed from my controller. class MyWorker < BackgrounDRb::Rails class MyResult attr_reader :result def initialize(result) @result = result end end def do_work() end def results MyResult.new(100) end end -- my_controller.rb -- def results results = MiddleMan.get_worker(session[:job_key]).results p results.result #=> undefined method `result'' for #<DRb::DRbUnknown:0x26d15a4> end I got around this by defining the class within the results method and returning like that. Really just wonder...
2006 May 08
17
partial problem
def my_controller @variable = [{''myfield''=>''grey''},{''myfield''=>''blue''}] end #-------------------------my_view <table> <%= render :partial=>''my_partial, :collection=>@variable %> </table> #-----------...
2006 Aug 16
4
Accessing Constants Declared in Helper Modules
Hello all, I''m having great trouble accessing a constant declared in a helper for one of my view templates. I am trying to create a grouped selection list based on a predefined set of values. Rather than declare this set of values in the view, I wanted to put it in the helper that automatically gets included for the view. Unfortunately, it doesn''t seem to work. All methods
2006 Mar 27
13
Is this a bug in Ajax handling?
When a controller responds to a link_to_remote with a redirect_to, the link_to_remote gets a success callback, this would seem like a bug to me, at a minimum it should return a failure? This is driving me crazy because all the login engines/generators respond to an authentication error with a redirect_to. The work around is to change them to all do a render :layout => false, :status => 500
2006 Apr 25
7
Rails producing the / page.
Hi all Very simple question, im sure, but I cant find docs anywhere that tell me how to do this. What I want is for the index page of the server to be generated from rails, is www.wibble.com/ will result in a page that has been processed by rails, has the templates etc. >From what I can see, the index page comes from public/index.html How do I get this to be a rails page? Thanks Jonathan