Questions tagged [decent-exposure]
6 questions
3
votes
2 answers
How can I stub a controller helper method in a view spec with RSpec 3.4?
I'm testing a view with RSpec (3.4 on Rails 4.2.5). And I use the decent_exposure gem in my CRUD controller. decent_exposure makes it easy to define named methods that are made available to my views and which memoize the resultant values.
But I…

eugene_trebin
- 1,485
- 1
- 16
- 29
1
vote
2 answers
How to save an object after submit with decent_exposure?
I'm completely at a loss! I'm using decent_exposure gem for a first time and I suppose the problem is in it.
That's the link https://github.com/hashrocket/decent_exposure
When I submit my form, it saves nothing. All my table in database are just…

Jakov
- 151
- 13
0
votes
1 answer
How to break down decent-exposure code to classic Rails way?
Can anyone break this code down for me and explain how this can be done in classic Rails way with callbacks(if any) and methods?
class SearchController < ApplicationController
expose :search_result, -> { SearchService.new(search_params).call }
…

Slava Tkachenko
- 13
- 6
0
votes
1 answer
expose_decorated is not working with posts variable. Why?
I try to use draper, decent_exposure and decent_decoration gems in my project, but something is not working correctly. It's strange, because I just copied this code from antoher project.
my controller is:
class PostsController <…

Hubert Jakubiak
- 853
- 8
- 19
0
votes
1 answer
How to make index view showing articles in descending order when using decent_exposure gem?
In decent_exposure gem doc there is an information, that we don't need to write down all standard controller actions (index, new, create, show, etc.), but we can only write create and update.
In my app I have articles, and my goal is to put all…

weezing
- 396
- 1
- 8
- 22
0
votes
2 answers
How do I send a two chained methods as a symbol?
In order to properly search my Posts using friendly_id, I use this query :
Post.friendly.find(params[:id])
But I need to wrap this method up and send it to my presenter class gem, decent_exposure. Which gives me a fancy place to include a method…

Trip
- 26,756
- 46
- 158
- 277