search for: activecontroller

Displaying 8 results from an estimated 8 matches for "activecontroller".

2006 Jan 04
7
recongizing the current controller in views
alright i am doing a simple self blog in ruby. Now iw ant to be able to determine which controller action i am in inside _form.rhtml. So if i am in new or the creation control than i want to insert the text box for topics else i want to display the topic base on id. (i could do those already, i just need help finding the right if statement.. something like (if currentpage ==
2006 Apr 22
4
Slice and dice plugin
...000_000} Animals.with_scope :find => {:conditions => {:name_contains => ''Tiger''}} do Animals.find :all end Finally, here''s an simple way to use this plugin to add lots of data slicing and dicing to any list actions you might have: class AnimalController < ActiveController def list animal_conditions = params.dup.reject! {|k, v| [:action, :control ler].include? k} @animals = Animal.find :all, :conditions => animal_conditions end end This allows urls such as /animal/list?name_starts_with=T&population_less_than=1000 Please take a look, the code is a...
2006 Jan 29
3
Models within Modules
I have models within a module file and access them from my controller with Module::Model syntax, but only get unitialized const errors. I even tried require ''mymodule'', etc, no avail. The Prg Google has ZERO help on this, and I can''t believe more people haven''t run into this issue. What''s the deal? Frustrated, John -- Posted via
2008 Apr 11
0
expiring cache outside controller (e.g. in rake tasks)
Hello, I need to expire cache outside controller, in my rake tasks. I want to use standard methods expire_fragment,etc.. but I can''t manage to use them outside controllers. I tried including ActiveController::Caching::Actions but didn''t work. Anyone has any solution? I''m losing my head how to do it... (besides manually deleting files) Thanks Uros --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rub...
2008 Jun 18
1
Ruby on Rails 2.1 Unit Testing
Hi, Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most interesting one is Unit Testing of RoR Applications. Just go through it and send me your comments. http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-unit-testing.htm Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2006 Mar 06
4
rails internals?
Is there a list for discussing Rails internals or is that kind of one of those jealously guarded secret things? Also, I seem to be being a bit of a prat today, but if you read this closely: http://www.rubyonrails.org/images/headlines/community.gif Bit of a grammatical error there. (Sorry!) Giles
2006 Apr 04
2
Sharing controller code between views - best practices?
Hi, I have controller code that needs to be shared between multiple different user type views and want to know what is considered ''best practice'' or what other people are doing out there. Example: I have admin users, salesperson users, and possibly another type of user. They all need code to add/edit/delete a property - and other abilities. The code would be identical(in
2006 Jul 15
2
Render -> ActionController -> Render -> ...
Hi Guys, ActiveRecord is great for being able to drill down through many tables. I often locate the very "top" record, and have a render :action => "show" display that top record. Often I want to drill down like: @kingdom.phylums.classes.orders.each do |order| render :partial => "order/show" end But, depending on the user who is logged in, they see a