similar to: REST on Rails implementation / lib directory and Controllers

Displaying 20 results from an estimated 70000 matches similar to: "REST on Rails implementation / lib directory and Controllers"

2006 Aug 14
1
Testing CRUD/Rest Controllers
I have a few simple controllers doing plain, simple crud in a standard way. now it''s not very DRY to write a funtcional test for each controller, since they are all doing the same (apart from a few variable names, but that could be easily inflected or so). is there a way to do this? e.g. does inheritance work with tests, so i define a base test first, inherit my other tests and add a few
2006 Jul 23
2
Recommendations for managing tests for non-models and non-controllers in rails?
I''ve got unit tests for a class library that I''m using in a rails project. Currently this is the only project using this library so I would like to keep the classes and tests in the rails project. I moved the classes under [app]/lib. I currently have the tests in [app]/test. It would be great if these tests were run every time I run ''rake''. What is everyone
2006 Jun 28
6
Rails 1.1.3 and routes to controllers in directories
Hi, All my controllers in subdirectories aren''t reachable by the normal urls anymore since my upgrade to 1.1.3. 404 errors. Did anybody else experience this? grtz Thijs -- Posted via http://www.ruby-forum.com/.
2006 Aug 01
2
restful controllers - howto nest with link_to?
Hi List, I''m trying to get my grip on the restful methods that are now part of edge rails. Making the first steps was impressive as well as easy because there are already great resources on the blogs of early adopters: http://www.ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-itand
2006 Jul 07
0
lib/ directory not working?
Hello all. I''ve got a file inside my lib directory called time_helper.rb. In it I open the Time class and add a method to it. When I hop into the console and try to use my new command, I''m told the method doesn''t exist. Any ideas? - Rabbit -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jul 21
1
Lighttpd for rails app subdomain apache for the rest
I want to host a rails app at mydomain.com/railsapp. For technical reasons I have to leave mydomain.com on apache. This means that I need to tell apache to proxy only requests for mydomain.com/railsapp to lighttpd. I have deployed in a situation like this before around a year and a half ago but it was a real pain. Lighttpd and rails have matured a lot in the year and a half since I did
2006 Feb 08
2
Best way to know the domain across all controllers?
Hello, I would like to use something like domain=request.domain and be able to access the domain variable across all my controllers. What is the best way to do so? In which file can I put the above variable declaration and still be able to access it application wide? I guess I am asking on assistance for using global variables in rails. Can anyone please guide me to a source
2006 Jul 26
5
Can we have have protected methods in our REST controllers?
I gotta be quick, sos if it seems rushed. Latest word from DHH is that the REST conttrollers should only have 4 methods : Create, Update, New, Delete If you don''t know about DHH''s latest thing then leave now, or go read about it on his blog. Does this mean i can''t have private methods in my controller?? I have a method that create and new share. Thanks Chris
2006 Jul 11
1
Aggregate Controllers
Hi, I''m developing a dashboard like page and basically want to combine the result of multiple actions on a page. I''ve done this so far: def index r1 = render_to_string :action => "action1" r2 = render_to_string :action => "action2" render :text => r1+r2 end This works, but now I want to render from other controllers and this is where
2006 Jun 19
1
How to deploy rails apps from a VM Ware Virtual Machine?
Has anyone had any luck deploying rails apps in a Linux VM image on a production MS Server 2003 with IIS ? If so which image did you use a a base? I am currently using a Gentoo image and have installed ruby and rails but after performing a rails testapp and running webrick with ruby script/server I get a page timeout when trying to visit http://0.0.0.0:3000or http://127.0.0.1:3000 and I get no
2006 Aug 09
3
REST Client
Hello, I would like to make some REST calls in my rails application which will then parse the XML results and display them in a view. What I am having a hard time doing is figuring out how to make the actual REST Call? I have figured out how to use XMLRPC , but the site only supports REST. Is there an easy way to initiate the GET/POST REST Calls that I need to make and analyze the returned
2012 Nov 06
1
Understanding the Rails /lib/ Directory
I am trying to learn how the Rails /lib/ directory works - and how to reference variables defined in a file placed in the the /lib/ directory for use in a View. I have a file called helloworld.rb and it''s saved in the /lib/ directory in my Rails application. The helloworld.rb file has the following code: module HelloWorld def hello @howdy = "Hello World!"
2006 Apr 26
2
Deploying Rails Application?
Hi, after someone has performed the ''rake freeze_gems'', how does one reverse this action? I guess my goal was to deploy a 1.1.2 rails application on a 1.0 rails host. Is this the correct step to perform for deployment. If any one has any insight, please drop me an e-mail and thanks in advance. Peace, -Conrad -------------- next part -------------- An HTML attachment was
2006 Nov 04
0
Namespacing controllers
Sorry for the dup, but didn''t get a response with the first one, so I cleaned it up a bit in hopes of getting a response. There has been a couple of blogs (one posted at weblog.rubyonrails.com"Things you shouldn''t do in Rails") that are stating namespacing controllers are bad and that you should avoid using them. This idea does not sit well with me and am curious as
2006 Nov 04
0
Controllers and Namespaces (no problem, just questions)
I''m a little late on finding this article: http://habtm.com/articles/2006/07/01/if-your-models-arent-namespaced-why-should-your-controllers-be-or-how-i-learned-to-stop-worrying-and-love-the-crud This idea does not sit well with me and am curious as to the Rails roadmap. I''ve seen a couple things demonstrated in examples (Rails Book, api) that later turn to become deprecated. As
2006 May 12
2
Logical organization of controllers
I find that many of my controllers have a dozen or more methods and that it can take a few moments to orient myself when I open a controller I haven''t looked at in a while. Does anyone have suggestions for organizing methods in a controller (alphabetical, by function, etc) to increase readability and scanability? -------------- next part -------------- An HTML attachment was scrubbed...
2006 May 30
1
sharing partials across controllers.
Hi, I was wondering if it is possible to share a partial across views in different controllers? If so, how would I go about doing this? Would I pass in a parameter to render(...) of the partial telling it where it is located? And help would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Aug 03
0
Single Table Inheritance and controllers
I''m using Single Table Inheritance in my rails application, and I was wondering if it''s possible to create controllers and views for the STI classes. I''ve currently tried this with a simple Item and an ActionItem class, but Rails complains that it can''t route to the controller for ActionItem. Is there something special I need to do to set this up? Will every
2006 Feb 21
1
Module level layouts and controllers
Is it at all possible to have a layout for a module? For example I have a module called ''admin'' and one called ''shop''. One is the frontend and one is the backend. However, I''d like a layout for each module area as obviously the two will be quite different although in some cases the functionality (controller) maybe very similar. Any pointers would be
2006 May 25
7
Grouping controllers
I''m grouping controllers to avoid cluttering the top-level namespace. First, I used script/generate Admin::Customers new edit show list and then I used script/generate Admin::Providers new edit show list. The generator created the subfolders correctly: I have an admin folder and inside there''s customer_controller.rb and provider_controller.rb. I have the same structure in