Tagged Questions
2
votes
1answer
44 views
Rails preventing ajax view duplication
I have a website where people can write articles and publish/unpublish them. This is done via single button on the page:
...
4
votes
2answers
57 views
How can I DRY up these routes?
I have a controller with just a few actions, not the whole 7 RESTful actions situation. Here's what I have so far for routing:
...
0
votes
2answers
118 views
5
votes
1answer
184 views
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 ...
2
votes
1answer
246 views
How do I DRY this code?
I have two main problems with a chunk of code. I need to interpolate 2 different models in a specific order in a list.
In the world of casinos, there are different types of games and jackpots. In ...
2
votes
1answer
104 views
Select records and fill hash
I use ruby 1.8.7. I have method wich select records and fill hash. In my opinion the code is not dry. Could somebody help me to refactor it and make it shorter and more elegant?
...
1
vote
2answers
194 views
Refactoring custom validator using lots of if's
I have a custom validator that checks the min and max score of different sporting leagues -- e.g., MLB, NBA, NFL, NCAAB, etc.
Here's short version of what it looks like:
...