I have a dropdown that displays multiple "principals", when a user picks a principal and hits submit the form passes a principal id param to the controller action. 

The issue is that I need that params value in multiple controllers. 

my view

```
  <div class="row">
    <div class="col-sm-12 button-wrapper">
      <%= form_tag(principal_analytics_path, method: 'get', class: 'form-inline justify-content-center') do %>
        <%= select_tag 'prid', options_from_collection_for_select(Principal.all, :id, :name), :prompt => "Select Principal", class: "form-control wrapper-space" %>
        <%= submit_tag "Search", class: 'btn btn-primary wrapper-space', :name => nil %>
      <% end %>
      <%= link_to "Clear", principal_analytics_path, class: "text-danger" %>
    </div>
  </div>

```

controller action

once I get a selected principals "books" I then need a way of passing the @pri\_books variable from one controller to another. Or a way just to pass in the 'params[:prid]` to multiple controller actions. I'm not sure how to go about doing this. Maybe a function that passes the variable from one controller to another?

```
  # displays graphs about principals.
  def principal_analytics

    @months_back = 12

    if params[:prid].present?
      # takes a principals id as a parameter.  
      # @months_back will determine how many months are shown in the chart.
      @pri_books = Book.principal_books(params[:prid], @months_back)  
    end

    respond_to do |format|
      format.html 
      format.js {}
      format.json { render json: {success: true}}
    end    
  end

```