-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Review Requested] Add scaffold_controller generator #83
Conversation
- User can now invoke `rails generate scaffold_controller Model`
That is an awesome idea, @ianks ! ❤️ Should we only provide I will try out your code and let you know, but I think it's a fantastic idea which will help lots of people to quickly get Roar running. If you want to help on Trailblazer, I need a bunch of generators there as well hint.... |
I think there is already a rails g representer in there, but I also added rails g collection_representer. I'm glad you dig it! I'm sure there is a bunch to be done as this is only the initial idea. Also, any idea about why it fails on Rails 3? Travis doesn't seem to like it! On Sun, Sep 28, 2014 at 8:03 PM, Nick Sutterer [email protected]
|
You can run the rails 3 test with |
@apotonick Fixed the tests. There seems to be a dependency issue with Minitest and Test::Unit. This PR also fixes that. Heads up, this generator only works for Rails 4++ |
@apotonick How would you feel about deprecating generator support for Rails < 3.0 ? It is lacking a ton of features for generators (namely,
Thoughts? |
e504778
to
48bb8fe
Compare
Absolutely, I don't even know if roar-rails works with Rails < 3? I don't think so! BTW, long-term we won't need roar-rails anymore as this is all way cleaner and simpler in Trailblazer. What I'm trying to say is, don't spend toooo much time on this, we're either moving away from Rails or Rails moves with us..... 😜 |
Sounds good man. I removed testing for Rails generatators for versions less than 3.2 😈 |
@apotonick Any word on this? |
I'll try to merge it tomorrow, thanks again! 🍺 |
paging @apotonick We should get this merged in. As a bonus, all tests will be fixed for incoming PRs 😉 🍻 |
def index | ||
@<%= plural_table_name %> = <%= orm_class.all(class_name) %> | ||
|
||
respond_with @<%= plural_table_name %>, :represent_with => <%= controller_class_name %>Representer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we go the Controller::represents
way here and set this on the class level instead of using :represent_with
in every action? This option was meant to be a work-around if you need to customise an edge case.
Do you use ::represents
at all?
Ah, never even knew it existed :) I can change that up. |
WHADAYAMEAN? It's the 2nd paragraph in the README: https://github.com/apotonick/roar-rails#represents-configuration!!!!! 😜 |
This is a PR request to integrate Roar with Rails'
scaffold_controller
functionality. This is a feature in both jbuilder and active_model_serializers that I liked, so I decided to do a Roar-inspired version of it.When a user executes
rails generate scaffold_controller Model
, it will now build out the stubbing for Roar including controller methods and Representers.I am asking for a some feedback on this because I do not know 100% if my default settings would be considered optimal, and I would love feedback to know what would be considered most 'sane' so users can get the best Roar-Rails experience with minimal effort. Please please please let me know if you think things can be done better and I will fix it! I have enjoyed this Gem greatly so glad I can help.