Topic: Quick questions and answers for beginners

Got a quick question that doesn't warrant its own thread? Post it in here and let's see if we can answer it! smile

vinnie - rails forum admin

Re: Quick questions and answers for beginners

What langauges would you recommend knowing before starting to learn about Ruby.

Re: Quick questions and answers for beginners

iTechno wrote:

What langauges would you recommend knowing before starting to learn about Ruby.

If you just want to learn Ruby itself, you can easily learn it as a first language. The book Learn to Program teaches Ruby to people who have little to no previous programming experience, and at less than $20 it's a steal smile

If you want to learn Ruby on Rails, it's helpful to already know a little about Ruby, in addition to anything you're going to be generating (i.e. HTML, JavaScript, XML), as well as knowing how HTTP works and a little about databases.

I'm not one of those "learn PHP/Java/etc. first" people because Rails is different in a lot of ways and you might as well learn it the Rails way instead of learning something the PHP way and figuring out how Rails is different.

vinnie - rails forum admin

Re: Quick questions and answers for beginners

How do you do a 301 redirect? redirect_to seems to send a 302.

Tech Cheat Sheets for Ruby, Rails, and much more!

Re: Quick questions and answers for beginners

SRTech wrote:

How do you do a 301 redirect? redirect_to seems to send a 302.

Stick something like this in your controller:

def moved
  headers['Location'] = 'http://new.location/your_page.html'
  render :nothing => true, :status => 301
end

Also remember you can do a server-side transfer/include as well if you want to leave the URL intact but show a different action for it:
def index
  list
end

And of course, there's always the option to perform 301 redirects in .htaccess if you're on Apache or similar.

vinnie - rails forum admin

Re: Quick questions and answers for beginners

vin wrote:
iTechno wrote:

What langauges would you recommend knowing before starting to learn about Ruby.

If you just want to learn Ruby itself, you can easily learn it as a first language. The book Learn to Program teaches Ruby to people who have little to no previous programming experience, and at less than $20 it's a steal smile

If you want to learn Ruby on Rails, it's helpful to already know a little about Ruby, in addition to anything you're going to be generating (i.e. HTML, JavaScript, XML), as well as knowing how HTTP works and a little about databases.

I'm not one of those "learn PHP/Java/etc. first" people because Rails is different in a lot of ways and you might as well learn it the Rails way instead of learning something the PHP way and figuring out how Rails is different.

Thanks Vinnie, that book looks good smile.

Re: Quick questions and answers for beginners

how do you freeze your current gems/plugins into your vender directory?

> rake rails:freeze:gems

Last edited by alistair (2006-06-05 20:36:18)

Re: Quick questions and answers for beginners

iTechno wrote:
vin wrote:
iTechno wrote:

What langauges would you recommend knowing before starting to learn about Ruby.

If you just want to learn Ruby itself, you can easily learn it as a first language. The book Learn to Program teaches Ruby to people who have little to no previous programming experience, and at less than $20 it's a steal smile

If you want to learn Ruby on Rails, it's helpful to already know a little about Ruby, in addition to anything you're going to be generating (i.e. HTML, JavaScript, XML), as well as knowing how HTTP works and a little about databases.

I'm not one of those "learn PHP/Java/etc. first" people because Rails is different in a lot of ways and you might as well learn it the Rails way instead of learning something the PHP way and figuring out how Rails is different.

Thanks Vinnie, that book looks good smile.

I found the online version by accident and liked it so much I went and bought the book yesterday. I've worked my way through half of the book (sadly, I there are a few do-it-yourself programs that I couldn't get to work. Just have to try harder). This book actually got me enthusiastic that I actually went back out and bought Programming Ruby, aka The Pickaxe, which looks good too.

Re: Quick questions and answers for beginners

I'm following a teach yourself type tutorial written by an american. By default prices are displayed as $. How can I change it to

Re: Quick questions and answers for beginners

mintball wrote:

I'm following a teach yourself type tutorial written by an american. By default prices are displayed as $. How can I change it to

Railscasts - Free Ruby on Rails Screencasts

11

Re: Quick questions and answers for beginners

mintball wrote:

I'm following a teach yourself type tutorial written by an american. By default prices are displayed as $. How can I change it to

vinnie - rails forum admin

Re: Quick questions and answers for beginners

Can you link to an action in another controller? For instance, say I have "projects" and "changes" (which I do).

I'm currently in:
- myapp/projects/show/1

Is there a way I can do:

<% link_to 'LinkName', :action => '<changes_controller action>', :id => @project %>

Or do I have to use reidrect_to (presumably from within my project_controller)?

Re: Quick questions and answers for beginners

thanks for the help number_to_currency will do what I want. I knew it would be obvious once someone told me.

Re: Quick questions and answers for beginners

try

<% link_to 'LinkName', :controller => 'changes', :action => 'index(or whatever)', :id => @project %>

Last edited by thabenksta (2006-06-20 10:56:02)

Re: Quick questions and answers for beginners

ROFL That's way too easy. Thanks. smile

<-- n000b.

Re: Quick questions and answers for beginners

Get used to it being way too easy wink

Re: Quick questions and answers for beginners

thabenksta wrote:

Get used to it being way too easy wink

Hopefully I can!

Posts [ 17 ]

Pages 1