apotonick/roar-rails — Issue #1: Undefined method `merge' 
Author: chrisupb
Created: 2012-01-05 19:42:05+00:00
State: open

Wohoo first issue...

lib/representers/user_representer.rb

module UserRepresenter
include Roar::Representer::JSON
include Roar::Representer::Feature::Hypermedia

property :username

link :self do
api_user_url self
end
end

controllers/api/users_controller.rb

class Api::UsersController < ApplicationController

def show
@user = User.find(params[:id])
@user.extend UserRepresenter
respond_with @user
end
end

_api_user_url_ is a valid route

Undefined method `merge' for nil:NilClass thrown in _api_user_url self_ . Actually I don't find this merge method...
More and more I think, these problems arise because I don't use ActiveResource.