Guest User

Untitled

a guest
Sep 25th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. get '/account/plans', to: 'accounts#plans'
  2. post '/account/change_plan', to: 'accounts#change_plan'
  3.  
  4. #accounts_controller.rb
  5. def change_plan
  6. @plan = Plan.find(params[:plan])
  7. current_user.plan = @plan
  8. current_user.save
  9. render 'payment_options'
  10. end
  11.  
  12. <div class="plan-details">
  13. <header class= <%= plan.css %> >
  14. <h3><%= plan.name %></h3>
  15. <small><%= plan.visibility %></small>
  16. <p><%= plan.card_description.html_safe %></p>
  17. <span class="plan-price"><sup>$</sup><%= plan.amount.to_s %></span>
  18. </header>
  19. <article>
  20. <%= plan.features_description.html_safe %>
  21. <%= link_to button_text, account_change_plan_path, title: button_text, :class=>"btn btn-md btn-block btn-outline-green" %>
  22. </article>
  23. </div><!-- end plan details -->
  24.  
  25. No route matches [GET] "/account/change_plan"
Add Comment
Please, Sign In to add comment