Closed softwaregravy closed 11 years ago
Which version of Rails and which version of Versionist are you seeing this with?
Rails 3.2.12 and versionist 1.1.0
This works for me:
> rails g versionist:new_presenter customer_record Api::V1
create app/presenters/api/v1/customer_record_presenter.rb
create test/presenters/api/v1/customer_record_presenter_test.rb
> more app/presenters/api/v1/customer_record_presenter.rb
class Api::V1::CustomerRecordPresenter < Api::V1::BasePresenter
def initialize(customer_record)
@customer_record = customer_record
end
def as_json(options={})
# fill me in...
end
def to_xml(options={}, &block)
xml = options[:builder] ||= Builder::XmlMarkup.new
# fill me in...
end
end
This appears to work for me as noted above. Re-open this if you find this not to be the case.
Looks like I mis-interpreted the docs.
I used
rails generate versionist:new_presenter <name> <module> <namespace>
vs.
rails generate versionist:new_presenter <name> <module namespace>
I have a version (v20130701 ) set up under an Api namespace.
So my folder structure for the presenters is app/presenters/api/v20130701.
Running the following will generate the files in the right place:
However, they are flawed with classnames:
vs. the correct output of