search for: somecontroller

Displaying 20 results from an estimated 27 matches for "somecontroller".

Did you mean: homecontroller
2011 May 25
1
warning: toplevel constant SomeController referenced by Admin::SomeController
This issue has been discussed before (http://www.ruby-forum.com/topic/ 125392) and after spending a while debugging through this, I still don''t have a solution. Lets try again? I have two controllers, SomeController and Admin::SomeController. When SomeController is loaded first (which happens under spork, found out by editing ActiveSupport::AbstractController) I get warning: toplevel constant SomeController referenced by Admin::SomeController and the second controller is not loaded. The first controller is pol...
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample: class SomeController < ApplicationController before_filter do |c| add_crumb "Blah", "/blah" #breadcrumbs plugin redirect_to :controller => "foo", :action => "bar" unless c.send (:has_package?) end # Rest of the controller... private def has_package? # A bunch of logic...
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon "submit" have it directly go to a controller method view? I have something that somewhat works, but I think there is probably a much easier way to do it. As of now, I have the dropdown list which when the form is submitted is handed to a controller method which basically I have my dropdown box: <%=
2008 Mar 08
7
ridding away with do_request
...(:create).with(....) post_create end end IMO is adds a little more readability when looking at an individual "it" behavior on a controller spec. We''ve been keeping the request helpers as the first things immediately following a controller specification, ie: "describe SomeController do". Thoughts? -- Zach Dennis http://www.continuousthinking.com
2007 Jan 31
1
help please!
Hi, I''ll appreciate insight on this one... it''s causing me some pain on my production env. <%= link_to "something", :controller => "somecontroller", :action => ''someaction'', :id => someid, :favorite => is_a_favorite %> I added a boolean :favorite to the URL arguments. THis has always worked well under my dev environment (webrick) and produced: <a href="/somecontroller/someaction/someid?favor...
2012 Dec 01
6
Why does 'extend ActiveSupport::Concern' cause `undefined method 'recycle!'`?
...ngine. I want to make the controllers customizable whereever the Rails Engine is used. Therefore, I was trying to use `extend ActiveSupport::Concern` on the Engine controller class and include it in MyRailsApp. https://gist.github.com/4185823 # code in my rails engine moduel MyEngine class SomeController extend ActiveSupport::Concern def engine_some_method end end end # code in my rails app where engine is implemented class SomeController include MyEngine::SomeController def app_some_method end # code that''s available by including the Rails Engine code # def...
2007 Jan 18
2
How to use API from AWS -- help!
...ely new application, so continuing: $> rails newapplication - "newapplication" will be one of the many applications that must use the users web service to register and login, etc. How can I access these methods? Here''s what I''m trying (with no luck): 1) In: class SomeController < ApplicationController I have, web_client_api :user, :xmlrpc, "http://localhost:3000/user/api/RPC2", :handler_name => "user_api" And I try using things like "user_api.authenticate(un,pw)" etc. Doesn''t work, I''m currently getting: "Missi...
2007 Nov 23
12
namespaced controllers
Out of curiosity, I''ve seen the following fail: module Admin describe MyController ... end end But this works fine: describe Admin::MyController .. end Why? Scott
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file. class UserControllerTest < ActionController::TestCase fixtures :users def setup @controller = UserController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @invalid_user = user(:invalid_user) @valid_user = users(:valid_user) end def test_login_success
2006 Jun 15
3
Need help creating a clever route
What I want to do is wrap all the scaffolded administrated pages for my webapp into an admin folder in the controllers and views folders. So... /app /controllers /admin issue_controller.rb article_controller.rb topic_controller.rb ... etc. ... /views /admin /issue _form.rhtml edit.rhtml list.rhtml new.rhtml
2009 Jun 14
3
Basic AJAX Response (Mootools)
...use Mootools to integrate a Moo-specific JS Script // @.js : new Request( { url: ''bla'' onSuccess: function(responseText, responseXML) { console.warn(responseText); console.warn(responseXML); } , onFailure: function(xhr) { alert(STD_ERR); } }).send(); // @SomeController : respond_to do |format| format.html { head :ok } format.xml { render :xml => ({:foo => "bar"}.to_xml) } end // Have tried format.json, with all the code involved (:json, .to_json), yet // nothing. The to_xml Method works in irb. The responseText is &q...
2006 Apr 22
7
Instance variables versus local variables
This novice coder roughly understands the difference between instance and local variables thanks to David Black''s excellent book, but I''m still unclear as to when and why a either is more desirable to use. In general, I use instance variables in my controller and local in my views, but I''m not sure as to why or if this is correct. Thanks Joe Kowalski
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone, I am trying to connect to multiple databases and followed along the Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about establishing the connection in a subclass of ActiveRecord::Base, and inheriting all classes in need of this connection from this class) Chad Fowler says: "You won''t be able to instantiate an External, of course,
2006 Mar 07
4
Controllers More Than One Sub-Directory Deep?
Does anyone know how to make Rails aware of controllers that might exist in directories that exist deeper than one level under the app/controllers directory? I initially figured just adding additional scope information might do the trik (i.e. Tabs::Admin::OneController or Admin::Tabs::OneController), but that does not seem to work. I''m guessing that I can just manually add these
2006 May 21
6
Is there a way to call helper methods in a controller?
Hi, Is there a way to call helper methods in a controller? I want to do something like this in my controller Class MyController < Action.... def my_method string = link_to "some_url", :controller => "home", :action => "command" end end link_to is an ActionView helper method and it seems that I couldn''t access the method in the controller
2006 Mar 10
3
External controller code
Hey, we like to realize a RoR project with a huge amount of controller code. What is the best way to handle that. Is there a similar mechanism for helper as for views or a way to include/load external code? Otmar Tschendel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060310/789a3fad/attachment.html
2007 Sep 22
0
How to DRY up controller action spec with different params.
I tend to write a fresh description block for every change in the parameters for that specific action, because I hate conditionals in the example describtion, e.g.: describe SomeController, "handling GET /path/with/param/3" do it "should do this" it "should not do this if" it "should still do that in both cases" end Seperate description blocks keep things clean, however, there is a big amount of duplication between the two blocks, I do love...
2007 Jan 04
2
remove html tags from string in controller, how?
Been searching for a function that can do this, but have onl found a helper function. is there a way to strip all html tags of a string in a controller? Thanks -- 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,
2009 Feb 25
0
Routes with parameters ordered differently
..., (and :a,:b and :c get mapped to params[]) what i''d like to do is make a mapping of the form map.connect ":foo/:controller/:action/:id" i''d like to do something like this so people can, say, choose a locale in the url as the param[:foo] (like http://myserver:3000/en/somecontroller/someaction/) is that possible? i tried adding the route: map.connect ":foo/:controller/:action/:id" and when i try to go to an address like the one i specified, it returns that no route matches. I''ve seen other posts in the archives that suggest this should work, but maybe t...
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys, I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9. Sadly, rails 3 no longer has javascript generators and I''m now forced to do more javascript. For my project, I have selected jQuery as the javascript framework for my rails 3.0.9 app. What I have done to have my app''s deletion link (for each item) trigger an alert box when the deletion