Sha256: 28701ffe20144c2b6e5517ce5f610b4c445219a2e20b9f9f3c5b540a6b37a6e0

Contents?: true

Size: 414 Bytes

Versions: 14

Compression:

Stored size: 414 Bytes

Contents

module JavascriptLab
   module ViewHelpers
      def mark_selected(value, input)
         return 'selected' if value == input
         ''
      end

      def create_option(key,value)
         selected = mark_selected(key,params[:j])
         output = []
         output << "<option value='/?j=#{key}' #{selected}>"
         output << value
         output << '</option>'
         output.join
      end
   end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
neerajdotname-javascript_lab-0.0.1 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.10 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.11 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.12 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.13 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.14 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.15 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.2 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.3 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.4 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.5 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.7 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.8 lib/javascript_lab/view_helpers.rb
neerajdotname-javascript_lab-0.0.9 lib/javascript_lab/view_helpers.rb