Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

BonzoESC posted:

I worked in a shop like that, where the pressure to deploy anything at all was interfering with my ability to make quality software.

I went to the management and said, "my last day is in two weeks," and haven't looked back. If they won't let you make quality software, they deserve what they get, and you don't deserve to get stuck with it.

I came here from being a sysadmin at a place where I had zero to do (and took a pay+benefits cut to come here). This is my first actual programming job even though I've been toying around with various languages etc for the last 15 years. I'm also in the mid-west where there aren't any tech jobs that don't suck, so I have to either build some experience here for a while and then move, or go back to sysadmining po-dunk networks.

They also hired me with 5 days RoR experience

Adbot
ADBOT LOVES YOU

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
I've been in a lot of dev shops that were at that level of errors, untested code and general horribleness, and while it's tempting to say "let's stop everything right now and do nothing but testing / refactoring", a lot of times that really just isn't realistic.

One approach that I've found works well is to set explicit rules about how you're going to deal with technical debt, in a way that you can get buy-in from the higher-ups that it won't grind development to a halt. Here's a good list of rules to start with:

  • Bugs are addressed the way they are right now, but developers need to first create a test that fails due to the bug. This makes regression testing easier (which I'm guessing based on what you've said is a huge problem for your QA department), and after a few months, the hotspots in your code will have decent coverage.
  • New code is developed using TDD.
  • Half a day every week is solely devoted to reducing technical debt. I'd personally handle this by allowing devs to work on whatever they want - they will probably have the best idea where the problem spots in the code are.

Even just 1 and 2 will go a long way to improving your codebase. You'll never have 100% coverage, but if the only areas in your code that aren't covered never change and never have issues, it's far less of a concern in my mind.

xPanda
Feb 6, 2003

Was that me or the door?
Could someone recommend a good Ruby on Rails RSS feed to follow?

I found when learning Python that subscribing to the Planet Python feed was great for getting to understand the community and the technologies out there. There is planetrubyonrails.com but I can't find a way to subscribe to it using Google Reader, and searching for 'ruby on rails rss feed' of course yields results about how to program one!

NotShadowStar
Sep 20, 2000
Rubyflow seems to be a good aggregation on what's going on.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

What's the 'main' page of my app called, or does it have a file name?

Basically what I want to do is allow Googlebot to index https://www.myapp.com as well as stuff like https://www.myapp.com/info or https://www.myapp.com/about

But nothing else. I can allow the other pages but if I disallow / in the robots.txt, it can't hit https://www.myapp.com. Which is expected.

hmm yes
Dec 2, 2000
College Slice
http://guides.rubyonrails.org/routing.html#using-root

NotShadowStar
Sep 20, 2000
It's also very common to have a static index.html in public/ for the front page if the front page doesn't change much. The front page is usually hit hard and it's blazingly fast to serve a static file than going through the whole Rails stack.

8ender
Sep 24, 2003

clown is watching you sleep
also this: https://github.com/thoughtbot/high_voltage

is pretty fly if you just need to serve up some static pages easily

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

8ender posted:

also this: https://github.com/thoughtbot/high_voltage

is pretty fly if you just need to serve up some static pages easily

I use that just because I can use markdown embedded in haml to make my static pages:
code:
- content_for :title do
  Privacy Policy
.prose
  :markdown
    # Privacy
    
    gurgle [hurgle](http://goatse.info/) tincidunt congue enim, ut porta lorem lacinia consectetur.
    Donec ut libero sed arcu vehicula ultricies a **non tortor.** Lorem ipsum dolor sit amet, consectetur
    adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper `sed`, adipiscing id dolor. 

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!


We have :welcome routed like that, but for some reason it doesn't work the way I want it to. They're just visiting / which goes through, and not /welcome

I'm just going to block all the ones we don't want in the robots.txt. Basically what happens is we get Exceptions from GoogleBot hitting random pages in our site that it shouldn't be. Or at least, we don't expect it to be.

customer-subdomain.ourapp.com/register/demo-password/ and stuff like that (which is actually done in AJAX)

NotShadowStar
Sep 20, 2000
Are you saying that you want / to be redirected to the URL /welcome?

What root :welcome does is match / to WelcomeController#index, not redirect.
Also, if some of your application errors are coming from Google trawling through your site and hitting AJAX only URLs, your AJAX setup is probably incorrect. Essentially you want the inverse of what this document tells you to do.
Actually, it takes work to get Google to find AJAX URLs, like it took Twitter and Gawker a whole site restructure to have an AJAX front end that's also Google indexable. Something else is really screwed up with your site structure.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

NotShadowStar posted:

Also, if some of your application errors are coming from Google trawling through your site and hitting AJAX only URLs, your AJAX setup is probably incorrect. Essentially you want the inverse of what this document tells you to do.

I'd bet he's using the link_to :remote stuff.

Pardot
Jul 25, 2001




Bob Morales posted:

customer-subdomain.ourapp.com

Unrelated to your problem, but I'd strongly advise against subdomains. They make full stack integration testing much harder than it has to be. And there's not much business value in subodmains. Most people don't know what browser they're using let alone care what the url looks like.


8ender posted:

also this: https://github.com/thoughtbot/high_voltage

is pretty fly if you just need to serve up some static pages easily

If you use this and are on heroku, you should look into setting the cache control headers to get varnish to cache it for you. It's not going to make a huge difference, really, but hey why not?

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Pardot posted:

Unrelated to your problem, but I'd strongly advise against subdomains. They make full stack integration testing much harder than it has to be. And there's not much business value in subodmains. Most people don't know what browser they're using let alone care what the url looks like.

The value in subdomains really becomes a lot more apparent when you get into multi-tenancy problems. If you can segregate / scope your entire data layer based on which subdomain is being accessed, things get a lot easier to deal with.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Pardot posted:

Unrelated to your problem, but I'd strongly advise against subdomains. They make full stack integration testing much harder than it has to be. And there's not much business value in subodmains. Most people don't know what browser they're using let alone care what the url looks like.

Everything I've read agrees with you, but they're 100's of customers and ~ 20 products in.

I put the robots.txt in yesterday, and Googlebot is still hitting us.

code:
User-agent: *
Disallow: /welcome/
Disallow: /register/
Disallow: /store/
Disallow: /toolkit/
Disallow: /content/
Disallow: /home/
But the bot is crawling /welcome/pilot and /home/register still

hmm yes
Dec 2, 2000
College Slice
Add Google Webmaster Tools and make sure it isn't using a cached version of your robots.txt

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
Anybody going to RailsConf this week? I'll be at the free Bohconf track Wednesday and Thursday.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

BonzoESC posted:

Anybody going to RailsConf this week? I'll be at the free Bohconf track Wednesday and Thursday.

I'm there now. Tutorial day was a little dull, looking forward to the keynote today. You should head over to the GitHub meetup on Wednesday, we'll have a beer.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

enki42 posted:

I'm there now. Tutorial day was a little dull, looking forward to the keynote today. You should head over to the GitHub meetup on Wednesday, we'll have a beer.

Cool! I'm bonzoesc on Twitter if you have it.

rugbert
Mar 26, 2003
yea, fuck you
edit - gently caress it fixed it.

Can I upload mutiple files with paperclip? The only thing Ive found on google was pretty outdated

rugbert fucked around with this message at 17:53 on May 18, 2011

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
I made a thing.



It plugs into a Rack application on Ruby 1.9.2 and allows you to browse the source.

For Rails 3:

Add gem 'cans' to your Gemfile.
Add mount Cans::Application.new, :at=>'/cans' to your config/routes.rb

Browse to /cans/browser for the pretty backbone.js-based browser.
Browse to /cans/ for the less pretty HTML-only views.

Source is at http://github.com/bkerley/cans

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Our web server puked this morning. Rackspace kept blaming Passenger/Rails, they couldn't get Apache restarted. What was wrong? /tmp was full! We have an image upload in a couple of our apps (company logos and poo poo like that, not image barn), and the programmer who wrote it didn't delete the temp files created. Ooops.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Linux guys, what are you using for a development setup? Are you choosing a distribution that has a current version of Ruby and then just installing rubygems, or are you compiling your own stuff?

Pardot
Jul 25, 2001




BonzoESC posted:

I made a thing.

That's cool. Were you inspired by seaside? If not, check out Seaside.

Bob Morales posted:

Our web server puked this morning. Rackspace kept blaming Passenger/Rails, they couldn't get Apache restarted. What was wrong? /tmp was full! We have an image upload in a couple of our apps (company logos and poo poo like that, not image barn), and the programmer who wrote it didn't delete the temp files created. Ooops.

That sucks. In general, I like uploading directly to s3, that way you can not tie up one of your web processes with an upload. However if uploading is a rare thing, it probably doesn't matter. Also, be wary of relying on the local filesystem, it'll make it harder to scale to multiple machines.

Bob Morales posted:

Linux guys, what are you using for a development setup? Are you choosing a distribution that has a current version of Ruby and then just installing rubygems, or are you compiling your own stuff?

I'm not using linux for my dev machine, but I can't recommend rvm hard enough, even if you find a distro that treats ruby well.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
Yeah, trying to use the ruby supplied by pretty much every package manager is the way of pain and misery. There is literally no good reason to not use RVM.

bitprophet
Jul 22, 2004
Taco Defender

enki42 posted:

Yeah, trying to use the ruby supplied by pretty much every package manager is the way of pain and misery. There is literally no good reason to not use RVM.

This, though I will point out that before RVM came around, I made do with finding a distro-compatible third-party Ruby build (e.g. a Yum repo or Ubuntu PPA) that was new enough (takes a short bit of searching / vetting), and installed Rubygems from source (easy as falling off a log). Worked pretty well.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Pardot posted:

That's cool. Were you inspired by seaside? If not, check out Seaside.

The presentation I made for lightning talks at Rubyconf 2010 actually had a screenshot from Squeak in it :)

bacon!
Dec 10, 2003

The fierce urgency of now

Bob Morales posted:

Linux guys, what are you using for a development setup? Are you choosing a distribution that has a current version of Ruby and then just installing rubygems, or are you compiling your own stuff?

Fedora / RHEL6. Gems are packaged as RPM, with the 'gem2rpm' RPM that makes RPMs out of Gems. Apache + mod_passenger

asveepay
Jul 7, 2005
internobody

Bob Morales posted:

Linux guys, what are you using for a development setup? Are you choosing a distribution that has a current version of Ruby and then just installing rubygems, or are you compiling your own stuff?

Ubuntu 10.04, rvm, build rubygems from source (stupid easy via instructions on their site), apache & passenger standalone

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled

asveepay posted:

Ubuntu 10.04, rvm, build rubygems from source (stupid easy via instructions on their site), apache & passenger standalone
This is my current setup as well. And redcar for editing.

Anyone remember back in the day, there was a windows app with ruby + rails + mysql + apache all ready to start with one click? That was awesome.

mrobot
Sep 11, 2004

Cock Democracy posted:

Anyone remember back in the day, there was a windows app with ruby + rails + mysql + apache all ready to start with one click? That was awesome.

still exists, Dr. Nic from Engine Yard is championing the Windows cause these days: http://railsinstaller.org/

asveepay
Jul 7, 2005
internobody

Cock Democracy posted:

... And redcar for editing.


is Redcar good now? I used it until they started building the new version, and then the development lagged so much I uninstalled it and switched to VIM, then gedit. One of my coworkers has been using redcar as well but he seems kinda 'meh' about it.

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled

asveepay posted:

is Redcar good now? I used it until they started building the new version, and then the development lagged so much I uninstalled it and switched to VIM, then gedit. One of my coworkers has been using redcar as well but he seems kinda 'meh' about it.
It still has some flaws. It takes forever to start up for one. I'm not a big fan of how you have to do "redcar install" after every upgrade. It's still my editor of choice though. It's just so easy to jump around to different files with CTRL+T. That, the syntax highlighting and auto-indent are its strong points IMO.

edit: spelling

Cock Democracy fucked around with this message at 16:35 on May 27, 2011

rugbert
Mar 26, 2003
yea, fuck you
I reinstalled my Ubuntu machine and am trying to install Rails3 (following this guide http://www.christopherirish.com/2010/08/25/how-to-install-rvm-on-ubuntu-10-04/ )via RVM but editing my .bashrc file isnt working. I think that last line
code:
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi

fi
and after looking around my home directory I see that there is no .rvm folder which would explain why rvm notes doesnt work.

Theres a /rvm/scripts/rvm in /usr/local but copying that folder to my home directory doesnt do anything :/

Schatten
Jul 7, 2002

Das ist nicht meine
schnellen Rennwagen

rugbert posted:

and after looking around my home directory I see that there is no .rvm folder which would explain why rvm notes doesnt work.

Theres a /rvm/scripts/rvm in /usr/local but copying that folder to my home directory doesnt do anything :/

RVM has an updated install path. Follow the instructions here: https://rvm.beginrescueend.com/rvm/install/

hepatizon
Oct 27, 2010

rugbert posted:

Theres a /rvm/scripts/rvm in /usr/local but copying that folder to my home directory doesnt do anything :/

That probably means you ran the install as root, which gave you a system-level RVM installation instead of a user-level one. That's not a problem as long as you follow the instructions accordingly: https://rvm.beginrescueend.com/rvm/install/

rugbert
Mar 26, 2003
yea, fuck you

hepatizon posted:

That probably means you ran the install as root, which gave you a system-level RVM installation instead of a user-level one. That's not a problem as long as you follow the instructions accordingly: https://rvm.beginrescueend.com/rvm/install/

Oh awesome, yea I must have instinctively typed in sudo before the curl. Thanks!

edit - I guess the only big change is that I have to type rvmsudo in place of sudo rvm ?

rugbert fucked around with this message at 19:39 on May 31, 2011

Dooey
Jun 30, 2009
I'm just learning Rails (and ruby and web development) and I heard about these fancy-pants things called models, views and controllers, and I feel like I should use them properly.

I have this

code:
  <b>Total support:</b>
  <%= debate.supports.count - debate.contests.count %>
in my view and I want to move the subtraction into its own function (since it will soon be doing more then just subtracting some stuff)

Where do I put it? I tried the DebatesController class and the Debate class but got erros when I do it any way besides this way.

smug forum asshole
Jan 15, 2005

Dooey posted:

I'm just learning Rails (and ruby and web development) and I heard about these fancy-pants things called models, views and controllers, and I feel like I should use them properly.

I have this

code:
  <b>Total support:</b>
  <%= debate.supports.count - debate.contests.count %>
in my view and I want to move the subtraction into its own function (since it will soon be doing more then just subtracting some stuff)

Where do I put it? I tried the DebatesController class and the Debate class but got erros when I do it any way besides this way.

I think the model is the best place for this.

Assuming 'supports' and 'contests' are separate columns in your debates table, add this to Debate class (model):
code:
def total_support
  self.supports.count - self.contests.count
end
then you can just call debate.total_support (or whatever you decide to call it) from your view.

Adbot
ADBOT LOVES YOU

NotShadowStar
Sep 20, 2000

Dooey posted:

I'm just learning Rails (and ruby and web development)
Step away from Rails for a while. Rails assumes you are an expert already, so if you're not you're likely going to be very, very lost. Especially with all the crazy abstraction poo poo 3.1 is going to do.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply