similar to: Mixins?

Displaying 20 results from an estimated 100 matches similar to: "Mixins?"

2015 Jun 20
1
Xapian with Json
Hi ! I?m newbie with Xapian ! I?m looking for the best way to index json data to be able to search by name/value pair and Full Text Search using only Xapian. I did haven?t success to found a complete or a good documentation about json index and search. Do you know some documentation about ? Another problem that I have is that: In the same name/value pair sometimes I have different data types
2010 Oct 14
1
Cucumber Selenium web step to verify value of input field
I have an input field with an id which has a value. The web_steps.rb method does not find the value. Is this the right step to use to check an input field? It works fine for a text_area but not an input. Scenario steps (tried both ways): Then the "travel_card_number_gate" field should contain "5" Then the "#travel_card_number_gate" field should contain "5"
2008 Mar 05
0
Index Searcher Causes GC Memory Error: "irb: double free or corruption"
My linux Ruby application is using Ferret 0.11.4. I created my own class IndexSearcher to contain the Searcher of multiple directories. If I do not have the searcher.close called, the end of runner/console or runner/server will pop out with system error: *** glibc detected *** irb: double free or corruption (fasttop): 0x0a51d6c0 *** ======= Backtrace: ========= /lib/libc.so.6[0x638ac1]
2006 Oct 31
5
mongrel parser for server response
I''m taking a stab at creating a parser to parse the server response using the mongrel parser as a base. Never having used a parser like Ragel before in my life, I''d like some input on the following for parsing an http server response. This is part of my modified version of http11_parser.rl. In particular what would be better than using ''any'' to match the
2006 May 11
1
Mixins
If I want to write a function which will be available to views, I write a helper function in one of the places set aside or that very task by Rails. If I want to write a little suite of functions to be mixed in by a number of model classes (but not all), where do I put them? Plug-ins look like AN answer, but they also seem a little heavyweight for simple, project-specific tasks.
2005 Nov 06
1
mixins not reloaded as expected?!
Hi guys, in development mode a module mixed into a helper class seems not to be reloaded inside app/helpers: class TestHelper include EvenMoreHelp #foo end module EvenMoreHelp # bar end the contents of #foo get refreshed, but not #bar... is there a way to fix that behaviour. I intend a full reload in development mode for obvious reasons. Regards Peter
2007 May 01
2
Using mixins versus delegation
I''ve been working on a plugin called Http Test where I add HTML validation and link checking to controller and integration tests through an after filter in ApplicationController. I used to mix in a bunch of methods that I needed into the ApplicationController class, but to me this had a bad smell, so I broke much of the code out into separate classes that I delegate to.
2007 Feb 08
0
derive.js - Ruby-esque derivation/mixins for Prototype
All, I whipped up a small extension for Prototype to solve some modeling issues I was having on a large JS project. I know there have been serveral alternative "write JS in Ruby" type efforts, including ruby.js, rb2js, and prototype.js itself, but I was hoping to keep it as light as possible while gaining the most powerful aspects of derivation/mixins/callbacks. Much like the prototype
2015 Mar 08
2
Xapian with Couchdb
Hi, I?m looking for how to integrate couchdb with xapian. Couchdb has a elasticsearch plugin, but i didn?t find anything about xapian. How is the best way to do it ? There some tips / tricks about xapian and couchdb ? Best Regards ! Carlos Brazil.
2006 Mar 05
8
Model Inheritance, Mixins and Database design
I''m trying to understand how best to use inheritance and wonder if Rail''s Single Table Inheritance model too restricting. I have a model Companies who provide 1+ Services (HABTM relationship). I assume the best way to represent this is with a series of child models representing each type of service : ServiceType < Company. I want to return lists of companys for each
2006 Apr 22
1
How to save data with dynamic forms?
Hello, Imagine I have a form designer, which allow me to design a web form (at run-time). I don''t have any idea how to save the data in db (table ddl?), so I can easily list or search the data. I though of writing the hash directly from the form to db, but I think there must be better solution(s)? Any idea, articles or design pattern on the subject? Thank you all in advance, Dunnil
2007 Nov 01
8
Specifying mixins
Hi folks, Can anyone share some accumulated wisdom about the best way to spec mixins in general, and (Jamis Buck-style) ActiveRecord "concerns" in particular? The standard situation here is that there''s a bunch of functionality, related by concept if not by implementation, that one wants to inherit in many different classes (e.g. ActiveRecord models) without having to
2008 Dec 09
7
subclassing vs mixins, which one should be used?
Hey all, I have two models in my rails project that share a lot of traits. They each have the same 4 properties, and now I need to add 2-3 methods to each one that will be the same. In the spirit of DRY I am looking for a solution to write these methods only once. Both of these models already inherit from ActiveRecord . . . and I didn''t know if it was safe to just "whip up" a
2006 Jul 21
1
Partial, Table Layout, Multiple Controllers/Models... DRY?
Hi, I am almost embarrased to ask this and I am sure it has been answered previously but the search feature is down on ruby-forum so I am not finding the answer. I have several controllers (leads, orders, activities, etc...). I have a ton of repeated html in each of the views for these controllers. For example, my list view has the same table/tr/td and for..in type of code and it just
2010 Jul 02
2
Update multiple fields with onclick
We''ve all seen the checkout forms with Bill To: and Ship To: I''d like to have a button that says "Ship to Bill To:" and if we click it, it copies all the Ship To: fields across such as phone, email, etc. I''ve been looking at link_to_function, is that the right path? I''ve done observe_fields before but that went to a controller action whereas here we
2006 Apr 08
7
text_field and arrays
Hi, I''m trying to do a bulk update on an array with the helper text_field. I''m trying to create an inputfield for every object in the array, but I''m not getting it right... example: class ClassA @arrayB[] end HTML (code with error): <% 0.upto(9) do |index| %> <%= text_field ''ClassA'', ''arrayB[index]'' %> non
2009 Apr 20
0
User defined model and validations?
I am trying to wrap my head around an idea and would appreciate any input from rails geniuses out there I would like to allow an admin user to define data that should be in a template, and then allow regular users to create instances of this template and have it validated. ie: - Template would have name, files and then x many fields of say "Text max length 20 chars", "Image size
2006 Jun 05
3
ActiveRecord validations and FormBuilder
Hi, I''m writing my own FormBuilder and I wanted to put an asterisk or something next to any required fields. The Builder has access to the AR object, is there any method I can call on the AR object that will tell me whether or not a particular field is required? Failing that, can I access the complete list of validations so I can look through it for instances of
2006 Oct 11
7
Mongrel HTTP Header Problem
Hi, I''ve recently been trying to setup Mongrel behind Pound so that I can do mutual SSL authentication. I''ve had a few problems with Pound (documented at [1]), but now have it working correctly. However, I think there is a problem with Mongrel and how it deals with the headers Pound adds to the HTTP header block. One of the extra headers Pound adds is
2012 Sep 11
1
Patch for Metadata::Padding
Bastiaan Timmer wrote: ... > In a > previous message I mentioned writing some more convenience functions, but on > closer inspection they would either be inefficient or very difficult > to implement. Could you briefly list these, in case somebody else wants to have a go. Many thanks, Martin -- Martin J Leese E-mail: martin.leese stanfordalumni.org Web: