-
Notifications
You must be signed in to change notification settings - Fork 1
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
labels not showing for preptimes or feeds on form page #30
Comments
Start tossing down the controller#action & then the file you're looking at to help me with locating the issue ... a quick search makes me believe I should be trouble shooting the workouts? |
sorry controller: recipes action: new and edit. |
Ok, so the behavior on these 3 (style/feeds/preptime) is the same - the issue is programmatically we haven't told the page to serve the labels even if blank. I went & clicked the check boxes next to two I made & then "viola!", we have "Feeds: 1". From programming & UI - you absolutely don't want the check boxes - the application should worry about whether or not to serve information, not the user. That being said, if you want the user to have the option to hide things, you could simply have Rails set a default of visible & that way later on users can go uncheck the box if they want - which would also save us the most programming time as we don't have to rewrite anything. Oddly though, right now your code is setup in such a way that it hyperlinks the "1" ... I left the make "feed" & preptime parts alone. I don't see a reason why "feeds" should be a hyper link - unless you want people to be able click that & then see all recipes which feed the same number of people? |
Ahhhh that makes a lot of since because i went thought everything and was like "these are the exact same >.<" Yeh i dont like the check boxes anymore either. When you say the application should serve the information does that mean setting up some way of categorising recipes? Because my initial plan was to add feeds, styles, preptimes and calories (calories feel apart) so the user could add extra information about their recipe before posting it. the i had a simple search where people could find recipes that also had i.e; feeds 2 etc. |
Roger, there's some different things in there - so lets break it down then .... For search purposes you should rely on the databases. 40 years of testing relationships/associations & file methods has shown us that a database executing it's proprietary code will always be 10-10,000 times faster searching for things & that's why there's a I don't do the With that in mind lets talk about laying out the database ... There's some 'forms' databases that are relational should follow to enable the fastest performance & easiest maintenance. The layman's of what I want to focus on is that for the most part, we want all the data related to a "thing" or a category to be in the same place. If it's not on the same table, we need an association to the table that holds all information for that category. I'm thinking that we need to have the recipe model (table) hold the categories...at least for feeds, preptime, ...for style, as you might want to enumerate I could maybe see another model to avoid like 13 spellings of sechwan or someone using chinese symbols...but that could also easily be controlled by having the form value validated in a function stored in the model...ie: (Note, I'm sure there's a rails way to loop through an enumerated list like this...but perhaps it's best to store the values in their own table and load them into array using a for loop to plop them into the validation test)
|
PS: I just pulled to add in these 3 to the recipes (for now not going to add validation - waiting on some feed back from a friend & going easiest route) |
Also, going to load in the changes in Issue #35 |
Change list
|
|
Note to self: Having issues with conflicts in feeds currently, can't assign it a default value as there's some association pulling on it - will go after this one next |
Thanks so much for spending the time writing that, i never knew it was such a massive performance difference between the two! I've been searching the internet for ages now trying to come up with some sort of way to stop multiple spellings for the same ingredient etc. I never thought of the problem like that! it makes a lot of sense to let the database do the work. Seems like you're making awsome progress btw! :) |
|
Something is still tripping me up:
I checked 30+ stackoverflows yesterday...8 hours solid pounding this one ... best options today...
Last attempt - replace .require with .fetch
|
Something is still tripping me up:
More guesswork ... What if the issue is set_user in recipe controller - there's no current_user in tests. If so .... I'm thinking if I use a hidden field to hold a helper that wraps devise's current_user then the testing might be easier? Some confirmed - I use the same code format in my app & it works. Why different? I'm not sure. There's tons going on. Next steps
Plan Zero:
Plan A:
|
Oh my god, you are an absolute machine! I think we've found another great example of why testing your code is so important. Although makes me worry what we might find down the track....oh well that's future us's problem hahaha. My initial thoughts are pretty much the same as yours; I think it might be easier to work on a skeleton. There's so much code in there from so many iterations, its kind of like finding a needle in a haystack. Did the |
|
I'm probably going to kill 4 hours on my berkley class now. Will check back later. |
I took a 3 hour wack at it....found out way more cool stuff....but no fix quite yet... Interesting things...
I am seeing this message 4 out of 6 times, but I need to rework this script somehow to record which ones pass. Error from param.inspection:
|
I clunked out there - the last hitch was rails 5 code in the assert params....for comparision...
|
Added bonus .... these are some of the weird ways I came up of checking for the issues ... mostly adapted from stackoverflow ... Note, the check_params & it's alternative work best if Also, my controller tests are all integration tests (check their inheritance at top)...as in rails 5 that's how it's done & I don't know what people in rails 4 do...
@jatwell93 check_params is setup with one var per line so I could easily comment it out (the comma's on the end can just stay, they don't hurt) & I kept the word order of the vars in the |
Pull request #41 is ready - I don't know if there will actually be issues merging this - as its been several weeks & if you were in the recipe controller - we are bound to have some conflicts. I didn't merge as I wanted to make sure you're going over it. Also, almost none of this actually affects that much of the views layouts - they will need to be altered or cleaned up eventually. |
I love reading through your examples, you make stuff a lot easier to understand than when I read through the stack overflow posts myself. Also, there was not merge conflicts :) so the branch has successfully been merged. |
thanks....we're just lucky people answer SO at all for questions...getting them to format it readable & explain why is a rare thing, much less strip out the useless parts! |
Minor issue but for some reason the labels for preptime and feeds dont show on the form page. Everywhere else they seem to appear.
The code for styles works, which i thought was the exact same.
The text was updated successfully, but these errors were encountered: