How do I place a link at the top of my page when the URL that it is pointing to is not determined until later down the page. In this example, I want to move Create and Edit Scenario links to the top of the page, but as you can see Edit Scenario depends on knowing the @scenario_id first.
<%= will_paginate @scens, :next_label => 'Older', :prev_label => 'Newer' %>
<div class="box">
<% for scenario in @scens %>
<% @created = scenario.created_at %>
<% @updated = scenario.updated_at %>
<% @scenario_id = scenario.id %>
<% if scenario.scenario_image.exists? %>
<%= scenario_image_tag(scenario) %>
<% end %>
<%= simple_format(scenario.description) %>
<% end %>
</div>
<% if session[:role_kind] == "controller" %>
<p>
<%= button_to "Create new scenario", :action => "create" %>
<% if @scens.size > 0 %>
<%= button_to "Edit scenario", :action => "edit", :id => @scenario_id %>
<% end %>
</p>