This is fine. by Deltamon in gaming

[–]sdn 1 point2 points  (0 children)

I would like to know more.

redirect_to - Ruby on Rails by alexat711 in rubyonrails

[–]sdn 1 point2 points  (0 children)

If you do a redirect, then the browser will do a new request and it's up to you to figure out what to show in that new request.

If, instead, you make a call to render and render the view that originally led to the update request, then rails can match up the attributes in the model which failed validation with the fields in your form IF you use the form builder.

You just need to make sure that if you do a render 'edit' (or any other view which does not correspond to the action) that you prime it with the other variables that are used by that view. ie:

def edit()
    @model = Model.find(params[:id])
    @variable = some_func()
end

def update()
    @model = Model.find(params[:id])
    @model.update(params_for_model)
    if @model.save then
        redirect_to @model
    else
        @variable = some_func()
        render 'edit'
    end
end

redirect_to - Ruby on Rails by alexat711 in rubyonrails

[–]sdn 0 points1 point  (0 children)

I don't know what form builder you use, but something like simple_form is very nifty -- you can do the following with it:

def update():
    @model = Model.find(params[:id])
    @model.update(params_for_model)
    if @model.save then
        flash[:success] = "Model updated!"
        redirect_to @model
    else
        flash.now[:danger] = "Model not updated
        render 'edit'
    end
end

And it'll actually highlight which fields had errors for you.

Why are combined home HVAC systems not a thing? by Seinken in AskEngineers

[–]sdn 2 points3 points  (0 children)

300-400°F as a high pressure high temperature gas.

That doesn't sound right. The critical point of R410A is only 162F (at 690psi). Condensing at that temperatures is extremely inefficient..

Cooks in Azkaban by perfectlyserious in harrypotter

[–]sdn -1 points0 points  (0 children)

Six!

The marauders, Rita, and McGonagall

I'm not the only one! by [deleted] in gaming

[–]sdn 2 points3 points  (0 children)

.... it's not?

Berlin mayor to Donald Trump: 'Don't build this wall' by xu85 in worldnews

[–]sdn 2 points3 points  (0 children)

"Sanctuary City" is not really a legal status or anything. It's just an unofficial policy that the police department won't go out of their (already busy) way to check the immigration status of every person that they come across. This is typically done to maintain community relations - ie: you don't want to be arresting people just because of their immigration status in case you need them .. to.. you know, help you out with giving info on real criminals.

A city can say "Yeah, we're not a sanctuary city anymore!" and then change nothing about how they conduct policing.

Using Nil to your advantage with RoR. by I-Am-Keith-Perfetti in rubyonrails

[–]sdn 0 points1 point  (0 children)

To add onto this, .try() is the best thing ever.

[Spoilers] Rogue one may have solved a Return of the Jedi problem. by N64GC in StarWars

[–]sdn 2 points3 points  (0 children)

Seriously, I was on the verge of kidney failure because I was holding everything in until the end of the film :D

My Third Attempt Petition Was Denied by [deleted] in EngineeringStudents

[–]sdn 1 point2 points  (0 children)

Community colleges don't work like that.. In texas you can transfer at max 67 credit hours from a community college to a 4-year institution.

Considering quitting my job to pursue engineering full-time. by kdawg119 in AskEngineers

[–]sdn 1 point2 points  (0 children)

I would definitely lean towards quitting your job and going to school full time. I haven't seen very many people who were able to keep a full time job and then survive the last semester or two while maintaining a job because eventually you get into classes that seem to take up 100% of your time.

However, I don't know your situation so please provide us with some more info:

1) The most important question is - where do you live?

$55k/yr is starting engineering pay for bumfuck nowhere (0 years experience - you technically have more!), but it can be considerably more in other parts of the country. Consider this:

  • Quitting your job and not working for 2.5 years will be a loss of ($137,500) to you. However, if you can get an $80,000/yr engineering job in your field immediately after graduating in 10 years you will be up $662,500.

  • Going part time for 6 years at $55k/yr and then 4 years at $80k/yr will net you $650,000.

However... in the first situation you will have 3 years of engineering work experience under your belt which can translate into promotions, raises, and other bonuses in the long run.

2) What's your relationship situation like?

Maintaining a family, working, and going to school is very very very difficult.

Is anyone here a member of The District gym off Broadway? Specifically looking for info on their climbing/Bouldering by lookingtoclimbSA in sanantonio

[–]sdn 0 points1 point  (0 children)

They've recently updated all of their padding - there are no longer any gaps. People sometimes drag extra mats to put on top of the existing mats and that's occasionally a hazard, but it's also your responsibility to note where your fall zone is.

Is anyone here a member of The District gym off Broadway? Specifically looking for info on their climbing/Bouldering by lookingtoclimbSA in sanantonio

[–]sdn 0 points1 point  (0 children)

To add on to this, there are roughly five walls - a new wall gets changed out each week with the occasional week being skipped due to finals, etc.

Is anyone here a member of The District gym off Broadway? Specifically looking for info on their climbing/Bouldering by lookingtoclimbSA in sanantonio

[–]sdn 1 point2 points  (0 children)

It is absolutely tiny. You can't compare it to any of the gyms in austin by any means. Note that the $40/mo rate is only if you sign up for an auto-pay membership. I believe a one month membership is $50 by itself. On the plus side, the day pass is only $12 so you can check it out yourself and see. They used to do a $5 saturday night climb, but I don't know if that's a thing anymore (call and ask).

With the population numbers in this town, it's a shame that physical activity isn't bigger because numbers wise, if more people were in to it the city could totally sustain a large, dedicated climbing facility.

100% agreed.

How is the atmosphere and how are the other people? From some of the pictures it seems maybe a little "bro-ey" with shirtless dudes standing around - which honestly is a little bit off putting, and frankly kind of made fun of in the larger climbing community - although I do get that the summers here are brutal and maybe their A/C isn't the greatest.

There are really only 2 or 3 people that do that and they're all regulars. Most everyone else keeps their shirts on. The crowd varies from night to night, but it's mostly college aged people here. I think the UTSA climbing team comes to climb once in a while. The A/C is pretty good.

I'd definitely say come on by.

Ruby Newbie (xpost from r/ruby) by Pa1indr0me in rails

[–]sdn 0 points1 point  (0 children)

You're going to have oddball ass issues on linux as well. The more you deal with rails, the more you'll find that the "one stop gem shopping".... really isn't ;)

Ruby Newbie (xpost from r/ruby) by Pa1indr0me in rails

[–]sdn 0 points1 point  (0 children)

Meh. I've been developing on windows with rails for the longest time. You should learn how to do linux for the server side stuff when you're ready to start deploying rails to a server, but you can do 99-100% of the stuff you need to do in windows.

You should treat learning how to do linux stuff and ruby/rails stuff as two separate things.

My Christmas Card this year. I've been single my whole life. by kelsofb in funny

[–]sdn 1 point2 points  (0 children)

how bright do I need to be :) ?

not very! source: me

Why does EA/DICE hate private servers? Is there gonna be control or do we have to PAY to name something we can't do anything with? by [deleted] in Battlefield

[–]sdn 0 points1 point  (0 children)

It's really twofold:

1) They make a cut of the profits of running the server for you 2) Stat padding & other server side mods make the quality of game play different from server to server