draper icon indicating copy to clipboard operation
draper copied to clipboard

Decorators/View-Models for Rails Applications

Results 70 draper issues
Sort by recently updated
recently updated
newest added

In the [test matrix, Ruby 2.5 failed](https://travis-ci.org/github/drapergem/draper/jobs/671282550#L339) (a lone failure in a build otherwise working) with this error: ``` 1) Rails::Generators::DecoratorGenerator the generated decorator inheritance with an ApplicationDecorator is expected...

needs reproduced

When we add `gem 'draper'` to our Gemfile in our Rails 5.0.x project, it breaks our ActionController::API requests by causing an empty string to be returned. I believe this is...

view_context

I ran into this very surprising issue last week. I added the attribute `open` to a model and then to the edit form of that model. Upon opening that edit...

delegation

I'm using Draper 4.0.1 and I have these models: ```ruby class Document < AR::Base; end; class InputDocument < Document; end; class OutputDocument < Document; end; ``` I also have a...

awaiting response
suggestion
inheritance

We have an unusual use cache where having this functionality would be useful to us: ``` module Draper class CollectionDecorator module UniqueContext def decorate_item(item) item_decorator.call(item, context: context.clone) end end prepend...

Rails: 5.1.2 Draper: 3.0.0 I have an `EventDecorator` and an `EventsDecorator` on the `Event` model. ```ruby class EventDecorator < ApplicationDecorator def short_listing 'short' # simplified for demo purposes :) end...

I struggled with figuring out how to use decorators for namespaced models so I added instructions to the readme.

Hi, In `README.md`: ``` As of version 4.0.0, Draper only officially supports Rails 5.2 ``` But, in `draper.gemspec`: ``` s.add_dependency 'activesupport', '>= 5.0' s.add_dependency 'actionpack', '>= 5.0' s.add_dependency 'activemodel', '>=...

I create a custom load strategy ``` module Draper module QueryMethods module LoadStrategy class ActiveRecordWithKlass def allowed?(method) @allowed ||= ::ActiveRecord::Relation::VALUE_METHODS + [:klass, :reflect_on_association] @allowed.include? method end end end end end...

Rails 6.0.0 Draper 3.1.0 Steps to reproduce: * in a view helper (under app/helpers) add a constant like `MY_CONSTANT = 'const'` * restart the rails server Buggy behavior: ``` /app/helpers/test_helper.rb:2:...