Module: Tracks::SourceViewSwitching::Helper

Defined in:
lib/tracks/source_view.rb

Instance Method Summary collapse

Instance Method Details

#source_view_is(s) ⇒ Object


54
55
56
# File 'lib/tracks/source_view.rb', line 54

def source_view_is( s )
  s == (params[:_source_view] || @source_view).to_sym
end

#source_view_is_one_of(*s) ⇒ Object


58
59
60
# File 'lib/tracks/source_view.rb', line 58

def source_view_is_one_of( *s )
  s.include?((params[:_source_view] || @source_view).to_sym)
end

#source_view_tag(name) ⇒ Object


50
51
52
# File 'lib/tracks/source_view.rb', line 50

def source_view_tag(name)
  hidden_field_tag :_source_view, name.underscore.gsub(/\s+/,'_')
end