Creation of a Select in a View
You could still use options_for_select without much hassle:

&lt;%= options_for_select (0..2).map { |i| [show_budget_mode(i), i] }, params[:current_budget_mode].to_i %&gt;


Of course, I'd recommend creating the array in the controller or a helper, rather than the view. The view should ideally do as little logic as possible.

Alternatively, you could use content_tag just the keep the code cleaner:

&lt;% (0..2).each do |i| %&gt;
  &lt;%= content_tag :option, show_budget_mode(i), selected: params[:current_budget_mode].to_i == i %&gt;
&lt;% end %&gt;


Again, I'd recommend moving stuff to the controller. Even a current_budget_mode helper method would help clean things up:

class SomeController &lt; ActionController
  helper_method :current_budget_mode, :budget_modes

  def current_budget_mode
    params[:current_budget_mode].to_i
  end

  def budget_modes
    (0..2).to_a
  end
end


which would clean up the view:

&lt;% budget_modes.each do |i| %&gt;
  &lt;%= content_tag :option, show_budget_mode(i), selected: current_budget_mode == i %&gt;
&lt;% end %&gt;


or

&lt;%= options_for_select budget_modes.map { |i| [show_budget_mode(i), i] }, current_budget_mode %&gt;