Skip to content

Conversation

gammons
Copy link

@gammons gammons commented May 24, 2014

This behaves very similar to the Rails flash.

This behaves very similar to the Rails flash.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) when pulling 346fa3c on gammons:add_flash into 8d39557 on lotus:master.

@gammons
Copy link
Author

gammons commented May 24, 2014

@jodosha I think I now know why you were thinking this should be an external gem. Is it because you were trying to avoid using the Session module by default when including Lotus::Action?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) when pulling e973f05 on gammons:add_flash into 8d39557 on lotus:master.

@jodosha
Copy link
Member

jodosha commented May 26, 2014

@gammons Thanks for this PR.

Lotus::Controller is designed to be a pure HTTP endpoint, where the sessions aren't always needed (eg. in an API app). Lotus (the gem) is designed for web applications, where it makes sense to have them enabled, and it will do.

The only thing that I'd like to discuss is about including or not this feature. From a "business perspective", we want to show human readable messages to our users, as a result of a successful/failing operation that they've asked. Because, I'm trying to push all the presentational logic in Lotus::View, I'm wondering if we can think about a solution in that framework, instead of here.

@fuadsaud
Copy link
Contributor

I was thinking about this and I'm really not sure if it's possible to push that responsibility into Lotus::View. Client web apps (built with frameworks like Ember, for instace) can workaround this because they're stateful and they have the control over the actions flow (kind of outside-in).

I think the responsibilities here could be divided between the action defined by the web application and the view. So, this action would provide some kind of standardized status object to the view and the latter would deal with the presentation related logic (like defining the messages to be displayed, etc).

Please note this would be a different type of action defined in the lotus gem (an extension to Lotus::Action, which would remain decoupled from Lotus::Action::Session.

@jodosha
Copy link
Member

jodosha commented Jun 26, 2014

@gammons or @fuadsaud would you like to explore alterative approaches? Eg splitting this responsibility with Lotus::View. Thanks!

@jodosha jodosha mentioned this pull request Dec 3, 2014
@jodosha jodosha closed this in #56 Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants