Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
8 Cards in this Set
- Front
- Back
- 3rd side (hint)
params
|
Rails uses to send a new query parameter in the URL.
|
Ex: @tweet = Tweet.create(:status => params[:status])
|
|
respond_to
|
can set formatting to render in XML or JSON.
|
respond_to do |format|
format.html format.xml { render : xml => @tweet } |
|
session
|
Works like a per user hash
|
session[:zombie_id] != @tweet.zombie_id
flash[:notice] = "Sorry, you can't edit this tweet" |
|
flash
|
Sends messages to the user
|
flash[:notice]
|
|
redirect <path>
|
Redirects the request. For example, if somebody does not pass validation.
|
redirect_to(tweets_path,
:notice => "Sorry, you can't edit this tweet") |
|
before_filter
|
Use to create methods that can be applied to multiple views. For example, to check authorization for edit, update and destroy.
|
before_filter :get_tweet, :only => [:edit, :update, :destroy]
def get_tweet @tweet = Tweet.find(params[:id]) end |
|
show
|
In the controller
def show @tweet = Tweet.find(params[:id]) render :action => 'status' end |
In the controller
def show @tweet = Tweet.find(params[:id]) render :action => 'status' end |
|
render
|
def show
render :action => :show end |
def show
render :action => :show end |