Class: ActionView::Helpers::InstanceTag

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_generator/generators/components/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Instance Method Details

#to_date_select_tag(options = {}) ⇒ Object



26
27
28
# File 'lib/rails_generator/generators/components/scaffold/scaffold_generator.rb', line 26

def to_date_select_tag(options = {})
  "<%= date_select '#{@object_name}', '#{@method_name}' #{options.empty? ? '' : ', '+ options.inspect} %>"
end

#to_datetime_select_tag(options = {}) ⇒ Object



30
31
32
# File 'lib/rails_generator/generators/components/scaffold/scaffold_generator.rb', line 30

def to_datetime_select_tag(options = {})
  "<%= datetime_select '#{@object_name}', '#{@method_name}' #{options.empty? ? '' : ', '+ options.inspect} %>"
end

#to_input_field_tag(field_type, options = {}) ⇒ Object



17
18
19
20
# File 'lib/rails_generator/generators/components/scaffold/scaffold_generator.rb', line 17

def to_input_field_tag(field_type, options={})
  field_meth = "#{field_type}_field"
  "<%= #{field_meth} '#{@object_name}', '#{@method_name}' #{options.empty? ? '' : ', '+options.inspect} %>"
end

#to_text_area_tag(options = {}) ⇒ Object



22
23
24
# File 'lib/rails_generator/generators/components/scaffold/scaffold_generator.rb', line 22

def to_text_area_tag(options = {})
  "<%= text_area '#{@object_name}', '#{@method_name}' #{options.empty? ? '' : ', '+ options.inspect} %>"
end