title: Ruby on Rails method that updates the value of a variable being activated from the view?
body: <p>I have a method called "renew" in my controller(using helper_method) that will add 30 days to the variable "subscription." I have a button in the view to call the method, but when I click the button, nothing seems to work.</p>
  
  <p>Here is the controller and the view snippets..</p>
  
  <p>posts_controller.rb</p>
  
  <pre><code>   def renewal!
      @post.expiration = @post.expiration + 30.days
    end
  </code></pre>
  
  <p>index.html.erb</p>
  
  <pre><code>        &lt;td&gt;&lt;%= button_to 'Renew', :action =&gt; 'renewal' %&gt;
  </code></pre>
  
  <p>UPDATE: </p>
  
  <p>routes.rb</p>
  
  <pre><code>  Rails.application.routes.draw do
  
    devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "callbacks"}
  
    root 'posts#index'
    get '/posts/owner', to: 'posts#owner'
    get 'search', to: 'posts#search'
  
  
    resources :posts do
      member do
        post 'renewal'
        end
    end
  </code></pre>