Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby on Rails, submit_tag with 3 checkboxes
    primarykey
    data
    text
    <p>I need something <a href="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_checkbox" rel="nofollow">like this</a> but in Ruby On Rails. I have a code that selectes specific files to be either deleted or analyzed:</p> <pre><code>&lt;% if @files%&gt; &lt;%= form_tag what_to_do_files_path, method: :get do %&gt; &lt;%= submit_tag "Delete selected", :name =&gt; 'delete' %&gt; &lt;%= submit_tag "Analyse", :name =&gt; 'analyse' %&gt; &lt;% @files.each do |file| %&gt; &lt;% if (arraydb.file=="no") %&gt; &lt;p&gt;&lt;td&gt; &lt;%= check_box_tag "files[]", file.id %&gt;&lt;/td&gt;&lt;%= file.name %&gt;&lt;/p&gt; &lt;% else %&gt; &lt;div class="my_profile_info"&gt; &lt;p&gt;&lt;td&gt; &lt;%= check_box_tag "files[]", file.id %&gt;&lt;/td&gt; &lt;%= file.name %&gt;&lt;/p&gt; &lt;td class="Info"&gt; &lt;a href="&lt;%=file.info%&gt;" target ="_blank" class= "btn btn-mini btn-info"&gt;Info&lt;/a&gt; &lt;/td&gt; &lt;/div&gt; &lt;% end %&gt; &lt;%end%&gt; &lt;%end%&gt; &lt;%else%&gt; &lt;%end%&gt; </code></pre> <p>routes:</p> <pre><code>resources :files do collection do get :what_to_do end end </code></pre> <p>controller:</p> <pre><code>def what_to_do method=params[:commit] if method == 'Delete selected' do smt elsif method == 'Analyze' do another thing end end </code></pre> <p>What I need to have are options for the "Analyze" button. Like Pictures, Info, Normalization, Scatterplots with a checkbox. So, I select Pictures and Normalization and klick on "Analyse", so only rthose two options will be proceeded. I am not quite sure how I can wrap a checkbox to a submit_tag.</p> <p>EDIT</p> <p>Example<br> choose option (checkbox)</p> <ul> <li>Normalization</li> <li>Pic</li> <li>Scatterplots</li> <li>Info</li> </ul> <p>choose files(checkbox):</p> <ul> <li>File1</li> <li>File2</li> <li>File3</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload