Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Commit

Permalink
Update syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Aust committed Jun 20, 2012
1 parent 8571870 commit f9d1b6e
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions README.md
Expand Up @@ -25,7 +25,9 @@ support since the server has no way to detect details like such.

Add this line to your application's Gemfile:

gem 'rakwik'
``` ruby
gem 'rakwik'
```

And then execute:

Expand All @@ -40,10 +42,12 @@ Or install it yourself as:
Rakwik comes as a Rack-compatible middleware which needs to be added to your application's
middleware stack on startup.

config.middleware.use Rakwik::Tracker,
:piwik_url => 'http://your.piwik.host/piwik.php',
:site_id => 'your_site_id', # eg. 1
:token_auth => 'yoursecrettoken'
``` ruby
config.middleware.use Rakwik::Tracker,
:piwik_url => 'http://your.piwik.host/piwik.php',
:site_id => 'your_site_id', # eg. 1
:token_auth => 'yoursecrettoken'
```

The `:token_auth` is needed since Rakwik will tell Piwik to record hits from another IP
than its own. The token_auth must be either the Super User token_auth, or a user with
Expand All @@ -54,28 +58,32 @@ than its own. The token_auth must be either the Super User token_auth, or a user
Piwik allows to set a custom action name which will be used in reports instead of the original
URL. To use it from your Rails application, include it into your controller like such:

require 'rakwik/helpers'
``` ruby
require 'rakwik/helpers'

class ApplicationController < ActionController::Base
# ...
include Rakwik::Helpers
end
class ApplicationController < ActionController::Base
# ...
include Rakwik::Helpers
end
```

In the particular controller activate it by using the `action_name` class method:

class BooksController < ApplicationController
action_name :page_title
# GET /books
# GET /books.xml
def index
@books = Book.all
@page_title = "Books"

respond_with @books
end
end

``` ruby
class BooksController < ApplicationController
action_name :page_title

# GET /books
# GET /books.xml
def index
@books = Book.all
@page_title = "Books"

respond_with @books
end
end
```

Currently, `action_name` points to a instance variable.

## TODO
Expand Down

0 comments on commit f9d1b6e

Please sign in to comment.