Class: CellsV1::Searchbar::Cell

Inherits:
Cell
  • Object
show all
Includes:
Ransack::Helpers::FormHelper
Defined in:
app/cells/lato_view/cells_v1/searchbar/cell.rb

Overview

Cella Searchbar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements: nil, filter: nil, url: nil, method: 'get', style: 'normal', remote: false, custom_class: '') ⇒ Cell

Returns a new instance of Cell.



39
40
41
42
43
44
45
46
47
48
49
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 39

def initialize(elements: nil, filter: nil, url: nil, method: 'get',
               style: 'normal', remote: false, custom_class: '')
 # assegno i valori alle variabili di istanza
  @elements = elements
  @filter = filter
  @url = url
  @method = method
  @style = style
  @remote = remote
  @custom_class = custom_class
end

Instance Attribute Details

#custom_classObject

Stringa contenente classi custom da aggiungere alla searchbar

  • default: nil



37
38
39
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 37

def custom_class
  @custom_class
end

#elementsObject

Nome dell’istanza del database da utilizzare nella ricerca

  • default: nil



12
13
14
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 12

def elements
  @elements
end

#filterObject

La variabile di filtro ricerca

  • default: nil



16
17
18
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 16

def filter
  @filter
end

#methodObject

Metodo con il quale il form deve comunicare con il controller

  • default: ‘get’



24
25
26
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 24

def method
  @method
end

#remoteObject

Valore booleano indicante se la serachbar deve utilizzare il remote true o meno nel form

  • default: false



33
34
35
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 33

def remote
  @remote
end

#styleObject

Stile della searchbar

  • default: nil



28
29
30
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 28

def style
  @style
end

#urlObject

Url custom a cui il form deve inviare la ricerca

  • default: nil



20
21
22
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 20

def url
  @url
end

Instance Method Details

#showObject



51
52
53
# File 'app/cells/lato_view/cells_v1/searchbar/cell.rb', line 51

def show
  render 'show.html'
end