search for: lazzeri

Displaying 14 results from an estimated 14 matches for "lazzeri".

Did you mean: lazzero
2006 Jul 14
3
Accessing the Model class from Controller
Hi, I wonder if there''s an easy way to access the associated Model class from its Controller. Something that would allow me to write snippets like the following: class PeopleController < ApplicationController def some_method person_model_class = self.some_method_to_retrieve_the_person_model_class() end end Cheers, Marco -- Posted via
2006 May 08
7
How to get difference between two dates in days???
Hi, I want to calculate difference between Current date & previous date (stored in database). The difference should be in days. Hhow to do that?? PLs tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
2006 Jul 24
1
Injecting actions into controllers
Hi, I''m trying to write a plugin that should inject an action into the controller. Please note, not just an instance method, but also an _action_, one of those that are listable by running ControllerClassName.action_methods. I wrote the following code: def render_field_search(name, object, controller, options = {}) controller.class.class_eval do
2006 Jul 07
2
Ajax "Waiting..." flash while round-tripping
I''m trying to figure out how to best allow a user to click a link_to_remote (or something like it) that will make the clicked thing disappear and replace it with a "Saving..." or "Please wait..." image until the server round-trip is complete. Once complete, it needs to replace the HTML in that span or div with text from the server. I imagine it will involve
2006 May 09
2
Disabling FOREIGN KEYs in a Rake task
Hi, How could I disable my database FOREIGN KEYs in a Rake task? Or, how could I call the execute() method in a Rake task? I''m trying to perform something like: task :delete_the_cippalippa => :environment do require RAILS_ROOT+''/lib/marsian.rb'' # FIXME: execute() is undefined execute "SET FOREIGN_KEY_CHECKS = 0" Cippalippa.delete(-1)
2006 Apr 03
1
Best way to set custom Controller options
Hi All! I''m searching a good way to set some options in my Controllers; I tried defining a custom function, ie: class PeopleController < ApplicationController set_my_actions :action1, :action2 end class ApplicationController def self.set_my_actions(*args) @@my_actions = args end end But ''@@my_actions'' sets the class variable to _every_
2006 Apr 14
2
Nested AJAX remote_form in form?
I''d like to achieve something that is better described by the following code: <%= start_form_tag :action => ''create'' %> <%= text_area ''place'', ''description'', :cols => 100, :rows => 4 %> <div id="categories"> <%= form_remote_tag :update => ''categories'',
2006 Jun 09
0
Ruby-GetText-Package-1.6.0
...You don''t need to call bindtextdomain in each files. # A textdomain belong to a file in previous version. # And a message is looked up in the file which called # GetText functions only. Thanks to: babie, charlie, Nobuhiro IMAI, Hiroyuki Iwatsuki, Yingfeng, Marco Lazzeri, Nobu Nakada, Gudao Luo, markus koller, and others. Website ------- http://rubyforge.org/projects/gettext/ * Download http://rubyforge.org/frs/?group_id=855&release_id=2856 * Ruby-GetText-Package HOWTOs http://www.yotabanana.com/hiki/ruby-gettext-howto.html * Ruby-GetText-Package HOWTO...
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 Jul 13
0
How to get dependent Model(s) from Controller
How can I get the dependent Model class from a Controller? I tried PeopleController.model and PeopleController.dependecies_on(:model) with no success. I''d like to avoid going through the Inflector.classify(self.controller_name) workaround. Thanks. Cheers, Marco
2006 Jul 28
0
How to call a controller class method via HTTP
Hi, did someone achieve in calling a Controller class method through HTTP request? ...without workarounds like: def call_my_class_method self.class.my_class_method end Marco -- Posted via http://www.ruby-forum.com/.
2006 Jul 31
0
Polymorphic has_many association through a belongs_to
Hi, Let''s say I''ve the following Models and their relative associations: Seat ---- belongs_to :booking Booking ------- has_many :seats has_many :debits, :as => :chargeable Debits ------ belongs_to :chargeable, :polymorphic => true Why >> seat.booking.debits nil while >> Booking.find(seat.booking_id).debits [] ? Thanks. Cheers, Marco
2005 Sep 16
0
Specify attributes for 'date_select' select inputs
Hi, I could not find an easy way to specify the ''id'' attribute for select inputs of ''date_select'' form helper. I need to set it because I want to retrieve date selects values from a javascript. <%= date_select ''product'', ''expiration'' %> generates <select name="product[expiration(1i)]">
2006 Jul 02
18
JOIN conditions
Hi, how can I get Rails to generate SQL queries with conditions in the JOIN clause? What I would want is: SELECT * FROM people p LEFT OUTER JOIN jobs j (p.job_id = j.id AND j.salary > 9999999) I tried People.find(:all, :include => ''jobs'', :conditions => ''jobs.salary > 9999999'') but that generates SELECT * FROM people p LEFT OUTER