The controller tag has no wiki summary.
4
votes
1answer
40 views
Code structure for a login modal dialog.
I'm using twitter mobile and I have a login-dialog. login-Dialog is a modal dialog. To call it the user calls loginDialog.show();
I'm not all that comfortable with the coding style I've adopted ...
1
vote
2answers
119 views
Search and Filter in MVC3 Razor I am using Linq, is there a better way to do this
Heres my Code and it works fine. I just dont like all the If else, what If I keep adding field to filter, its going to get messy. Ps: I am not using EF and cannot on this. Thanks.
CONTROLLER CODE
...
4
votes
1answer
112 views
How to improve this design?
I have some design doubts regarding my controllers and I would like some advice...
Everything works. However, I'd like to improve it.
Basically I have one controller per screen(Swing).
I have created ...
1
vote
2answers
53 views
How can I refactor this oversized Ruby method into smaller bits and have unit tests for them?
This is the existing code. Clearly way too much is going on in this index method and furthermore it's untested (and hard to test in its current form).
def index
# @s = ""
# @now=DateTime.now
...
4
votes
2answers
194 views
PHP MVC controller code needs diet?
This is the dashboard controller code in PHP Symfony 2. It collects some aggregate data and points for charts, but i don't like it very much. Do you think that this code belongs to what a controller ...
1
vote
2answers
70 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 that helper methods were preferred.
...
8
votes
5answers
2k 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 -
# It is a Cause
if @causality == "C"
@relationship.cause_id = @issueid
...
3
votes
1answer
235 views
Need help with cleaning up this Controller
I've written the following controller and i was looking for some input/advice on how i could go about cleaning this up or rewriting it. I feel like i'm repeating myself a lot or that there might be a ...
2
votes
2answers
472 views
Repetition in Controller code
In the index view a user can search with any combination of one to all of the following parameters: firstname, lastname or ssn. The found search results are displayed in the search results view. In my ...
3
votes
3answers
463 views
Not feeling 100% about my Controller design.
Basically, I'm uploading an excel file and parsing the information then displaying what was parsed in a view.
using System.Data;
using System.Data.OleDb;
using System.Web;
using System.Web.Mvc;
using ...