Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <%=link_to 'result', resultpage_path, :controller => 'resultpage', :action => 'result1', :class => 'btn btn-default'%>
  2.  
  3. class ResultpageController < ApplicationController
  4.  
  5. def index
  6. end
  7.  
  8. # regardless of what is in the :action =>, the controller always calls Show.
  9. def show
  10. @prize = Prize.first
  11. render :index
  12. end
  13.  
  14. # if i make the :action => 'result1', the controller still calls Show.
  15. def result1
  16. @prize = Prize.last
  17. render :index
  18. end
  19.  
  20. <h2><%= @prize.title %></h2>
  21. <p><%= @prize.description %></p>
  22.  
  23. resources :resultpage do
  24. get 'index'
  25. get 'show'
  26. end
  27.  
  28. resources :prizes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement