Tagged Questions
0
votes
1answer
33 views
Is it reasonable to have separate controller actions for different user registration paths? Or should I refactor into a fewer number of actions?
I have two registration paths in my app. They are very similar and I am curious if I should simplify 4 associated actions down into two actions that handle the same amount of work.
Here are my ...
1
vote
1answer
76 views
Cleanup controller action
I would like some help to clean up this action, especially from @companies and downward. The comments should be enough to explain :)
...
1
vote
1answer
88 views
Duplicate SQL code in controller
How I can rewrite or refactor my controller code? I have the same SQL query (@plan_gp_users) in all defs.
...
1
vote
2answers
161 views
Rails - Loading data in controllers
I am refactoring my controllers, trying to improve the way common data is loaded for the actions.
Initially I was using before_filter methods to do this but read ...
8
votes
4answers
3k views
How would you refactor this if statement of a Rails controller?
I first saw this gigantic if and tried to refactor it. Could only end with a endless switch statement.
Old code -
...