similar to: dash symbol

Displaying 20 results from an estimated 1000 matches similar to: "dash symbol"

2006 Apr 23
3
custom form builder
In the API docs I found this: "You can also build forms using a customized FormBuilder class. Subclass FormBuilder and override or define some more helpers, then use your custom builder " I couldn''t find any further documentation on this. Where can I read more about this formbuilder class? For starters, where would I define a subclass of this class? TIA, Jeroen --
2005 Dec 27
2
Rewriting FormBuilder
Hi, I want to extend formbuilder to make it output a lable (I know about labeled_form_helper made by technoweenie), my own formating, and a couple of extra tags inside the form attribute. I was easily able to extend form_remote_to. But when I continue to adjust the way elements are handled I don''t know how to continue. I can''t find the method text_field thats should is
2012 Jan 01
4
Chronic parsing date range in console but not in application in rails 3
Hey all, Chronic will parse a date range in console: Chronic.parse(1/1/2011 - 1/1/2012, :guess => false) => 2012-01-01 12:00:00 -0500..2012-01-01 12:00:01 -0500 However, when I use logger to check if it''s parsing in application, it is not: logger.info "The value of history date is #{history_date}" => The value of history date is 1/1/2011 - 1/1/2012
2012 Sep 20
2
append_features(mod)
append_features(mod) The documentation says: When this module is included in another, Ruby calls append_features in this module, passing it the receiving module in mod. Ruby’s default implementation is to add the constants, methods, and module variables of this module to mod if this module has not already been added to mod or one of its ancestors. See also Module#include. What if this module is
2012 Sep 22
4
Class, Module, Object
>> reload! Reloading... => true >> puts Class < Module true => nil >> puts Module < Class false => nil >> puts Module < Object true => nil >> puts Object < Module false => nil >> Object.parent => Object The above indicates that the Class object instance inherits from the Module object instance and the Module object instance
2012 Jan 21
4
why doesn't an instance of Object get Class's new instance method?
"Object is the root of Ruby''s class hierarchy. Its methods are available to all classes unless explicitly overridden." Wouldn''t Class class be at the root of the class hierarchy? After all, look at this: 1.9.2p290 :006 > Object.instance_of? Class => true Object is an instance of class, after all we can use one of Class'' instance methods on Object:
2012 Sep 09
2
mattr_accessor inside a class
Rails extends Ruby with mattr_accessor (Module accessor). As Ruby''s attr_accessor generates getter/setter methods for instances, mattr_accessor provide getter/setter methods at the module level. In below example, you see that mattr_accessor declared in the class context of LookupContext. It''s declared in class, not module. However, modules are defined in LookupContext, for
2012 Sep 09
2
What module are the <% %> and <%= %> defined in?
What module of ActionView are the <% %> and <%= %> defined in? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2012 Sep 02
1
to_model
There''s a number of calls in the Rails source to convert_to_model, which takes an activerecord object instance: convert_to_model(object) Here''s the thing. All convert_to_model does is calls to_model, which returns self (the ActiveModel instance). Am I missing something here? Why call a method that returns the same thing? @user => #<User id: 3, name:
2010 Feb 10
7
undefined method join
Hey all, I get an undefined method `join'' for #<String NoMethodError. student.rb has_one :student_fail attr_accessor :student_fail_attribute #controller def student_fail @student = @student.find params[:id] def update_student_fail @student.build_student_fail params[:student][:student_fail_attribute] if @student.save #view form_for @student do |f|
2012 Sep 21
2
in Rails, what is the main (global) scope called?
For example, you see files called rails/actionpack/lib/action_controller/base.rb which adds methods and such to the open module ActionController. What scope is ActionController in? Is it just called the global scope? Obviously, there is namespace resolution lookup. And a good example of this is in the Base class of the same file. It references one module like this: AbstractController::Layouts
2012 Jan 22
4
undefined method `gsub!' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span
Hey all, I am getting this error: NoMethodError (undefined method `gsub!'' for 2012-01-22 17:00:00 -0500..2012-01-23 00:00:00 -0500:Chronic::Span): in this code: date_range = Chronic.parse(the_date, :guess => false) reports.sum_distance_by_date(date_range).each do |d| u[:m] << d end def
2011 Nov 02
1
getting devise to return json data when signing out
Hi all, In curl (the command line program), I can successfully log a user in using devise: def create respond_to do |format| format.json { if user_signed_in? return render :json => {:success => true, :errors => ["Already logged in."]} end resource = warden.authenticate!(:scope => resource_name, :recall =>
2008 Apr 10
3
Custom Form Builder Help
Hello All, We use a different custom form builder for our app, but I wanted to use facebooker''s typeahead widget in side the other form builder. I don''t know much about form builders, but I created a file in lib/ doing this: http://pastie.caboo.se/178776 It works great, except that the id''s and class names get messed up. Instead of school_name, I get
2010 Jan 18
3
The role of self and :: within a method of a model
Hey all, I understand that a def self.abc, for example, is a class method, which allows you to call its contents by just referencing model.abc (rather than model.new.abc). However, what is its role when located in a method inside a model like in the code below. Also in the code below, you see :: located in the method. Isn''t that used for modules and namespaces? If so, why is it located
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in ActionView::Helpers::TagHelper to do some generalized error handling similar to the way scaffolding puts a red border around fields that fail validation. I''ve created a file lib/rails_patches/tag_helper.rb which contains the following. module ActionView module Helpers module TagHelper alias_method :orig_tag, :tag
2011 Sep 13
3
Accessing Rails helper method with_output_buffer
Hi all, I cannot figure out how to correctly use the with_output_buffer helper method (located in ActionView::Helpers::CaptureHelper) inside a custom FormBuilder. Below follows a simplified example. I''m trying to achieve the following behavior in an ERB as suggested in the form_for helper docs in the Rails source: ========== <%= form_for @object, :builder => MyFormBuilder do
2008 Aug 27
5
VALIDATION QUESTION
I''m trying to validate a record before save. I''m using one controller in this case furnii where I have all my calls. The problem is that, the form containing the field I''m trying to validate resides in the furnii views. I tried to add validates_presence_of :content (the field name) in both the furnii model and the ratecomment model but it does not work. I know there
2013 Apr 03
2
strange behavior with active relation any? method
In console, I run the following and any? returns true: drivers = Driver.select("drivers.*, drivers.id").joins([:reports, :driving_habits]).where("extract(MONTH FROM reports.time) = ? AND extract(YEAR FROM reports.time) = ?", 3, 2013).uniq.order("drivers.id asc").page(2).per(1) drivers.any? => true This correctly evaluates to true because the relation contains one
2011 Jul 11
2
Pre-populating association
Hello, I think this is an easy one for the average Rails developer but I''m a bit stuck. I''m creating a simple voting app: any user can create a survey, with any number of questions, and other users can then vote by creating a ballot for that survey. Here''s the modeling: class Survey < ActiveRecord::Base has_many :questions has_many :eligibilities has_many