Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Ruby on Rails is an open-source web development framework written in Ruby. If your question code is written in Ruby on Rails, tag with Ruby as the language tag. Many things are defined by convention, freeing you from having to re-invent things to stay productive.
4
votes
2
answers
65
views
Method for gathering the correct data to a specific user
I have quite a lengthy method that I know for sure can be optimized, yet I am not sure how to do it. The method is in my User model, and essentially gets the questions assigned to the user in the curr …
2
votes
1
answer
216
views
refactor helper for default state for rails select with enums
I've created a helper method that is essentially used to get the default state of an select:
<%= select_tag "question_main_frequency",
options_for_frequency_state(frequency_segment(questio …
4
votes
4
answers
583
views
Check if a store is currently open
This is the dirty bastard of my current code block, and I'm trying to find a way to improve this code for increased readability, but also functionality.
The method checks if the store is currently op …
8
votes
1
answer
109
views
Adding product with attributes
I've been working on refactoring a piece of my code that allows a user to add items to their cart. Each product can also be added with different attributes. Thus if somebody adds the same product, wit …
2
votes
1
answer
110
views
Checking whether a store is open or not by querying over its business hours
I currently have a method that checks if the store is open. It's working nicely, however on the main page I have quite a few stores. Whom again have different locations. Each of these locations again …