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
pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe
Any recommended modern Ruby and/or Rails guides? Gotta learn Ruby and Rails for a possible job! And I need to work! I know how to program, so something akin to K&R would be nice, unless the reference book Matz wrote like 12 years ago is still good? Seems like everything that was written was 10+ years ago...but new versions of the language are out, so uhh...there has to be updates, right?! Thank you much :)

Adbot
ADBOT LOVES YOU

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

The Milkman posted:

As long as it covers Ruby 2.0+ you should be fine. And even then there's not THAT huge of a difference. Why's Poignant Guide was old when I got into Ruby and I'm sure it's still a good reference.

Agile Web Development with Rails gives you an intro to Ruby and Rails, up to date on both, as well as stepping through building a full application.

Rails Test Prescriptions also from pragprog is good for learning Rails from a TDD perspective.

Practical Object Oriented Design in Ruby and Eloquent Ruby are still standards for Ruby Mindset.

If you're just looking for straight reference material,
The guides and API docs ought to get you there.

Awesome, I’ll take a look at all these! Thank you much! :)

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe
Seeking: buddy to talk nerdy to me about Rails/Ruby. Started hardcore diving into it this past weekend and I think I'm getting it, but still learnin'! Slide into my DMs tyvm <3

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

I can and will do both tyvm sir :colbert:. I figured out my last issue tho, only took like 4 hours and banging my head lol. Rails is v interesting, learning a shitload just using the official guides! I see how Rails can be v easy, especially if you have web programming experience, it's kind of just wiring a lot of poo poo together. Onward!

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe
I'm trying to just display a very simple static HTML page. I'm obviously missing something incredibly stupid here. Is the incredibly stupid thing that static pages are required to go into the public folder?

In my routes.rb, I have
code:
 root to: "static#index" 
The app is running locally on my machine, it spins up on localhost:3000. My app/controllers/static_controller.rb is so:

code:
class StaticController < ApplicationController

  def index
  end
end
According to the docs, I think, this should just render whatever erb it finds in app/views with the name index.html.erb, right? I go to localhost:3000 on my browser, it sends a GET /, right? Then Rails is supposed to run the 'index' action of the static controller, then render the final page using, Templates, Partials, and Layouts, right? The index.html.erb should be sufficient, right?

Okay so I have one index.html.erb in app/views/static, as well as another one in app/views, both are displaying different poo poo so I can try and differentiate them. In one index.html.erb:

code:
<html>
  <body>
    <h1> welcome poo poo!</h1>
  </body>
</html>
In the other:

code:
<html>
  <body>
    <h1> hello and welcome!</h1>
  </body>
</html>
Nothing is popping up when I go to localhost:3000 though! Refreshing does nothing! Restarting the server (bin/rails server) does nothing! What is the incredibly obviously stupid newbie thing I'm missing here! Please help so I can love the Rails and also get paid to love on Rails thank you <3

EDIT: Even tried changing the html to this:
code:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a purrrrrrrrr</h1>
<p>This is a different thing!!!!!!</p>

</body>
</html> 
And nothing! I feel dumbs please halp!

pliable fucked around with this message at 14:35 on Jul 2, 2021

Adbot
ADBOT LOVES YOU

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

kayakyakr posted:

It was the wrong start script because the app is a React SPA with a rails API, not a traditional rails view app.

Yup, this is the problem! I should have just tried it on the hello world app, but I tried using that as a reference to continue figuring out how all this poo poo works for this particular app, not knowing that this app was an API-only app :cry:.

In the config/application.rb, there is one line that says

code:
config.api_only = true
And so I think Rails does its black magic fuckery at that point to prevent views from happening. Sorry y'all, false alarm, this is why I want a buddy to chat with live and not poo poo up the thread! I'm getting overzealous with all this stuff lol

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