Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%=link_to 'result', resultpage_path, :controller => 'resultpage', :action => 'result1', :class => 'btn btn-default'%>
- class ResultpageController < ApplicationController
- def index
- end
- # regardless of what is in the :action =>, the controller always calls Show.
- def show
- @prize = Prize.first
- render :index
- end
- # if i make the :action => 'result1', the controller still calls Show.
- def result1
- @prize = Prize.last
- render :index
- end
- <h2><%= @prize.title %></h2>
- <p><%= @prize.description %></p>
- resources :resultpage do
- get 'index'
- get 'show'
- end
- resources :prizes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement