title: Correct way to call Ruby script in HTML
body: <p>Is this the correct way to call a ruby script in an HTML file?</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form id="cse-search-box" action="mechanize.rb"&gt;
  &lt;input type="text" id="text" name="text_name" class="mytext" /&gt;
  &lt;input id="search" type="submit" value="" style="border-style: none; background: url('search.png') no-repeat; width: 50px; height: 50px;"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Ruby</p>
  
  <pre><code>require 'rubygems'
  require 'mechanize'
  
  a = Mechanize.new { |agent|
    agent.user_agent_alias = 'Mac Safari'
  }
  
  a.get('http://google.com/') do |page|
    search_result = page.form_with(:name =&gt; 'f') do |search|
      search.q = 'Hello world'
    end.submit
  
    search_result.links.each do |link|
      puts link.text
    end
  end
  </code></pre>
  
  <p>Instead of executing the Ruby code, it displays the Ruby code in the browser in text. Is this possibly because I incorrectly installed the Ruby gem or because I'm calling the .rb file incorrectly with <code>action="mechanize.rb"</code> ?</p>