Class: Tableficate::Filter::InputStart

Inherits:
Input
  • Object
show all
Defined in:
lib/tableficate/filters/input_range.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs, #field_name, #label, #label_options, #table, #template

Instance Method Summary collapse

Constructor Details

#initialize(table, name, options = {}) ⇒ InputStart

Returns a new instance of InputStart.



4
5
6
7
8
# File 'lib/tableficate/filters/input_range.rb', line 4

def initialize(table, name, options = {})
  super(table, name, options)

  @field_name += '[start]'
end

Instance Method Details

#field_value(params) ⇒ Object



14
15
16
# File 'lib/tableficate/filters/input_range.rb', line 14

def field_value(params)
  params[:filter][@name][:start] rescue ''
end

#nameObject



10
11
12
# File 'lib/tableficate/filters/input_range.rb', line 10

def name
  "#{@name}_start".to_sym
end