search for: my_classes

Displaying 17 results from an estimated 17 matches for "my_classes".

Did you mean: max_classes
2009 Apr 08
4
Having trouble extending a class from a Rails plugin
I have class in a plugin that I want to crack open and add some functionality to for a particular application. So, I created a file by the same name as the class in my app/models folder and added some methods to the class, but, I can''t seem to get Rails (2.2.2) to pick-up the extended definition. I did find while trying to debug the problem that if I paste the extended definition into,
2006 Feb 16
3
Retrieve a property defined in a css
Hi all, I have a property, defined in an external stylesheet: .my_class { background-color: #FF0000; } I want to retrieve the value of this background-color of the class my_class. How can I do that with prototype/scriptaculous ? Thanks in advance, Nicolas Terray
2007 Jan 12
2
Forking a process in Rails is messing up mongrel
I''m trying to run an external Ruby script from my Rails app. To do this i''m using this function def fork_with_new_connection(config, my_class = ActiveRecord::Base) pid = fork do begin my_class.establish_connection(config) yield ensure my_class.remove_connection end end Process.detach(pid) end Then, within my controller I do this:
2006 Dec 17
12
Best practices for conditional display in views?
Hi. I am writing an application that has a lot of boolean conditional display logic, like this: <% if user.description then %> <p class="css_class"><%= user.description %></p> <% end %> Often the displayed content is more complex than the above, and to clean up my views I am trying to pull a lot of this sort of thing into partials. However, the problem
2006 Mar 30
0
design question - user data from two different sources
hello, how would you go about this: I would like my app to be able to alternatively draw user data from two sources - a users table in a database and an LDAP server. By alternatively I mean it would be set up to draw from one of these sources, not both at the same time. I would like to have objects of type Person which I would use regardless of where this person is stored, so both the active
2006 Feb 26
1
Help with ruby=>html
Hi! I''m new to ruby and rails and got problems with using basic methods like form_tag or link_to etc to create what i need, i.e. to specify css class or id or name of html elements. I have problem with understanding rails api (it''s just as an example): form_tag(url_for_options = {}, options = {}, *parameters_for_url) what parameters can i pass to form_tag? How to specify
2013 Feb 22
0
Custom utils lib
Hi all, Is it possible to have a custom utils lib in puppet ? By exemple I want to have a custom class used in many custom facts and many custom function : module_utils/lib/puppet/my_class.rb And in my custom fact I can call this class : > require ''module_utils'' Facter.add("custom_fact") do > setcode do > var = Puppet::Utils::my_class.getVariable()
2013 Oct 13
2
LAMP stack with strange dependencies
Hello everyone. I''ve been toying around with puppet and something happened that seems strange to me. In site.pp I have the following: > node default { > > # This is where you can declare classes for all nodes. > > # Example: > > # class { ''my_class'': } > > # class { ''lamp'': } > > package
2011 Oct 11
1
recursive finds
...ould have to get a listing of all of the puppetclasses within the chain of Hostgroups to which ServerA belongs. So this is my code... @hosts.each do |host| @ancestors = Hostgroup.find(host.hostgroup.ancestry) unless host.hostgroup.ancestry == nil @ancestors.puppetclasses.each do |anc| @my_classes[anc.name] += 1 end end And this works for me because I am only nesting 1 level but it''s conceivable that other users would nest many more levels and if my patch is to be accepted, I undoubtedly have to account for an infinite level of nesting. How would I accomplish that? -- Craig Wh...
2010 Dec 04
0
[LLVMdev] [cfe-dev] draft rule for naming types/functions/variables
On Dec 3, 2010, at 8:03 PM, Thiago Farina wrote: > On Mon, Nov 29, 2010 at 5:02 AM, Anton Korobeynikov > <anton at korobeynikov.info> wrote: >>> I enjoyed the new coding style in recent patches. Camel case makes it easy >>> to pick a descriptive name. Starting functions and variables with lower >>> cases reduces chances to conflict with a type name. >>
2010 Dec 05
2
[LLVMdev] [cfe-dev] draft rule for naming types/functions/variables
On Sat, Dec 4, 2010 at 5:14 AM, Chris Lattner <clattner at apple.com> wrote: > Thiago, > > The coding standards (which have been finalized and comitted) don't dictate names for local variables. > Do you like the fact that local variables start with capital letter? Following the same convention used to name classes? It's a very strange adoption. I like the way that
2006 Jul 07
1
Style on _fields
How can I modify the style of a RoR field like text_field or password_field? I can use input in css, but how do I add a class? -- Posted via http://www.ruby-forum.com/.
2006 Mar 04
3
:class in link_to_remote?
Is there a way to set the class of a link in link_to_remote? I tried adding :class => "this_damn_class" after the :url hash and it didn''t work. I went ahead and did it manually using remote_function, i.e. <a class="this_damn_class" href="#" onclick="<%= remote_function ..., :url => {...} %>">My Link</a> -- Posted via
2007 Feb 23
2
[RoR],[C.L.R] How I convert a string object into a class?
People, Lately I''ve been using the .name() method of classes. For example: Person.name => "Person" Today... I''d like to do the inverse: "Person".to_class => Person How do I transform a string into a class? I''m working with a Rails app where I need to get names of AR classes at run-time. -Peter
2010 Dec 04
2
[LLVMdev] [cfe-dev] draft rule for naming types/functions/variables
On Mon, Nov 29, 2010 at 5:02 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote: >> I enjoyed the new coding style in recent patches. Camel case makes it easy >> to pick a descriptive name. Starting functions and variables with lower >> cases reduces chances to conflict with a type name. > Honestly speaking, I don't. Especially in the cases when varname is
2007 Mar 13
5
worker starting twice
Hi gang, Thanks to other help I''ve gotten on this list, I''ve got backgroundrb up and running using postgres alongside my rails app. I''ve designed the system to have several eternally-running workers that periodically poll the database to see if there''s any work for them to do, and set things up in the config file to make them restart quickly if any of them
2017 Apr 28
2
RFC: Improving performance of HashString
According to... https://github.com/rurban/smhasher/blob/master/README.md Bernstein has quality problems (while xx is as good as you get in a non-crypto hash), and xx is 7x (32 bit) - 12x (64 bit) faster. That's on long strings. It would be worth checking the startup overhead for typically short identifiers in programs. See later on in the README: "When used in a hash table the