# A few newbie questions about RoR

**URL:** <https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748>\
**Category:** Rails\
**Created:** [September 5, 2008, 12:18am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748 "2008-09-05T00:18:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 12:18am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/1 "2008-09-05T00:18:10Z")

</div>

Hi,

my website is developed by a webdesign office, but now I want to be able  
to change the website myself. I’ve knowledge about php and html but I’m  
new to RoR.  
So now I want to create a new page on our site, but I don’t know how to  
do this. This is what I tried:  
-I’ve manually wrote a controller (newsletter.rb)and placed it in the  
controller folder  
-I’ve wrote the newsletter.rhtml (in the newsletter folder that is  
stored in the views folder)

But when I try to open the page on IE, I get a 404 error.  
I used the same structure that the other pages uses.

I hope you can help me.

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 1:06am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/2 "2008-09-05T01:06:17Z")

</div>

Without seeing the code this is just a wild guess, but the first place  
I’d look would be config/routing.rb. That’s the file that controls  
which requests go to which controllers - assuming your controller is  
valid, the 404 says the request never got to it.

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 1:09am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/3 "2008-09-05T01:09:13Z")

</div>

I strongly suggest that you spend some quality time on a RoR beginners  
tutorial before you adventure without a clear map of where are you  
going.  
I also highly recommend to buy the Agile Web D. with Rails  
from David Thomas and do the tutorial on the first part.

Is not that I can’t help you, is that your question is so basic, that  
I know you haven’t read (and practice) a basic beginners tutorial.

Look for one of the many blog creation tutorial with rails also. That  
should give you enough knowledge to start modifying you site.

Good luck!

Best regards,  
Jorge Corona.

On Sep 4, 5:18 pm, Olivier P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 1:12am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/4 "2008-09-05T01:12:08Z")

</div>

Also as a wild guess, he needs an action called as the template, as a  
minimum.  
It seems that this is the problem. (again, without looking at the  
code).

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 2:39am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/5 "2008-09-05T02:39:14Z")

</div>

your controller isn’t looking for newsletter.rhtml. It’s looking for  
an action, such as show.rhtml. Also, if you’re using a more recent  
version of rails, it’s probably looking for show.html.erb (rhtml seems  
to be out of favor). Definitely buy the Agile Web D. book  
(there’s a 3rd edition in development right now–make sure you get the  
beta PDF of that; the 2nd edition is pretty outdated now).

On Sep 4, 3:18 pm, Olivier P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 3:57am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/6 "2008-09-05T03:57:37Z")

</div>

Hello Olivier,

One thing I noticed and no one else mentioned (I don’t like to duplicate  
advice unnecessarily) is your controller should be  
newsletters\_controller.rb not just newsletter.rb. Here is something that  
should get you going (but do take the advice of getting a book, and  
Agile Web D. With Rails is a good one):

app/controllers/newsletters\_controller.rb

class NewslettersController \< ApplicationController  
def newsletter  
end  
end

app/views/newsletters/newsletter.html.erb

This is our newsletter!

And you should be able to see that with  
[http://localhost:3000/newsletters/newsletter](http://localhost:3000/newsletters/newsletter), assuming you are running  
this on your local computer by way of script/server.

Now, this is not the best way of doing things, but this should at least  
get you something to say “Ah”.

Peace,  
Phillip

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 11:21am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/7 "2008-09-05T11:21:43Z")

</div>

If you really want to learn it, best to do as the previous emails  
mentioned: buy a book or read tutorials online

then, if I may add: do development on a local machine. Editing a live  
app isn’t recommended and it’s more difficult to see errors there.

On Fri, Sep 5, 2008 at 4:42 PM, Olivier P.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> @Phillip  
> @classname = “m2”
> 
> \<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> 
> ```
> opacity: true
> 
> ```
> 
> =\> "Firstlink") %\>
> 'Administratie', :action =\> 'database\_entry' %\> - \<%= link\_to 'Telefoonpermanentie', :controller =\> 
> - 'Marketing', :action =\> 'freelance\_marketeer' %\>
> 
> 'Dienstverleners' %\>
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ramon T.

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 10:42am UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/8 "2008-09-05T10:42:53Z")

</div>

I’ve already read several RoR tutorials, but they are all talking about  
a server that is on your local machine. And I don’t know how to use the  
rails generate command on my webhosting. Or is it allowed to write the  
controller manually?

@removed\_email\_address@domain.invalid  
Our website is only 1 month old, and the webdesign office use .rhtml for  
everything.

@Phillip  
I’ve done exactly what you’ve told me but I still got the 404 error.

## Here are the codes of the pages: nieuwsbrief\_controller.rb (app/controllers/nl/nieuwsbrief\_controller.rb)

class Nl::NieuwsbriefController \< ApplicationController  
layout “nl”

def index  
@menuitem = 1  
@classname = “m2”  
@pagetitle = “Firstlink - Nieuwsbrief”  
@description = “Nieuwsbrief Firstlink”  
@keywords = “nieuwsbrief”  
end

end

## nl.rhtml (app/views/layouts/nl.rhtml)
\<%= @pagetitle %\> \<%= stylesheet\_link\_tag 'master' %\> \<%= javascript\_include\_tag "mootools-release-1.11.js" %\> \<%= javascript\_include\_tag "datepicker\_nl.js" %\> \<%= javascript\_include\_tag "default.js" %\> \<%= yield :contact %\>

\<% if @classname %\>

.\<%= @classname %\> { display: block;}

\<% end %\>

# [Firstlink](http://www.first-link.be "Firstlink")

## Uw dienstenbedrijf voor secretariaat en marketing

\<%= link\_to 'Login', :controller =\> 'Login' %\>

\<%= image\_tag("header\_graphic.jpg", :alt =\> "Firstlink") %\>

- \<%= link\_to 'Home', :controller =\> 'Welkom' %\>
- [Administratie](#administratie)
- 
  - \<%= link\_to 'Database entry', :controller =\> 'Administratie', :action =\> 'database\_entry' %\>

- [Secretariaat](#secretariaat)
- 
  - \<%= link\_to 'Freelance secretaresse', :controller =\> 'Secretariaat', :action =\> 'freelance\_secretaresse' %\>
  - \<%= link\_to 'Secretariaatsdiensten', :controller =\> 'Secretariaat', :action =\> 'secretariaatsdiensten' %\>
  - \<%= link\_to 'Telefoonpermanentie', :controller =\> 'Secretariaat', :action =\> 'telefoonpermanentie' %\>
  - \<%= link\_to 'Thuiskantoor', :controller =\> 'Secretariaat', :action =\> 'thuiskantoor' %\>
  - \<%= link\_to 'Dictafoon transcriptie', :controller =\> 'Secretariaat', :action =\> 'dictafoon\_transcriptie' %\>

- [Vertaling](#vertaling)
- 
  - \<%= link\_to 'Vertaalwerk', :controller =\> 'Vertaling', :action =\> 'vertaalwerk' %\>
  - \<%= link\_to 'Tolkwerk', :controller =\> 'Vertaling', :action =\> 'tolkwerk' %\>
  - \<%= link\_to 'Verslaggeving', :controller =\> 'Vertaling', :action =\> 'verslaggeving' %\>

- [Marketing](#marketing)
- 
  - \<%= link\_to 'Mailing', :controller =\> 'Marketing', :action =\> 'mailing' %\>
  - \<%= link\_to 'Telemarketing', :controller =\> 'Marketing', :action =\> 'telemarketing' %\>
  - \<%= link\_to 'Televerkoop', :controller =\> 'Marketing', :action =\> 'televerkoop' %\>
  - \<%= link\_to 'Copywriting', :controller =\> 'Marketing', :action =\> 'copywriting' %\>
  - \<%= link\_to 'Freelance marketeer', :controller =\> 'Marketing', :action =\> 'freelance\_marketeer' %\>
  - \<%= link\_to 'Conferenties', :controller =\> 'Marketing', :action =\> 'conferenties' %\>
  - \<%= link\_to 'Webdesign', :controller =\> 'Marketing', :action =\> 'webdesign' %\>
  - \<%= link\_to 'Presentatie', :controller =\> 'Marketing', :action =\> 'presentatie' %\>
  - \<%= link\_to 'Nieuwsbrief', :controller =\> 'Marketing', :action =\> 'nieuwsbrief' %\>
  - \<%= link\_to 'Tevredenheidsenquête', :controller =\> 'Marketing', :action =\> 'tevredenheidsenquete' %\>

- \<%= link\_to 'Diensten', :controller =\> 'Diensten' %\>
- \<%= link\_to 'Info & Offerte', :controller =\> 'Info' %\>
- \<%= link\_to 'Toegevoegde waarde', :controller =\> 'Toegevoegde\_waarde' %\>
- \<%= link\_to 'Referenties', :controller =\> 'Referenties' %\>
- \<%= link\_to 'Dienstverleners', :controller =\> 'Dienstverleners' %\>
 \<% if not @home %\> - [\<%= image\_tag("vertical.jpg") %\>](http://www.first-link.be/nl/secretariaat/freelance_secretaresse)
 \<% end %\> 

```
  <%= yield %>

</div>
<div id="twilight" class="clearfix">
  <ul id="lang">
    <li>Nl</li>
    <li><a href="/fr" title="Fran&ccedil;ais">Fr</a></li>
    <li><a href="/en" title="English">En</a></li>
  </ul>
  <%= yield :welcome %>
</div>

```

 \<%= link\_to 'Sitemap', :controller =\> 'Sitemap' %\> | \<%= link\_to 'Contacteer ons', :controller =\> 'Contact' %\> 

Copyright © \<%= Time.now.year %\> [Firstlink](http://www.first-link.be "Firstlink")

## index.rhtml (app/views/nl/nieuwsbrief/index.rhtml)

Nieuwsbrief tekst

PS: Nieuwsbrief is Newsletter in dutch, these 3 pages uses exactly the  
same structure as the other site pages.

---

<div class="post-metadata">

**Author:** ![olivier\_14](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e79b87/32.png) [@olivier\_14](https://www.ruby-forum.com/u/olivier_14)\
**Post date:** [September 5, 2008, 2:48pm UTC](https://www.ruby-forum.com/t/a-few-newbie-questions-about-ror/147748/9 "2008-09-05T14:48:27Z")

</div>

OK, I will buy a book and setup a development server.

But can I after I’ve setup the server just simple copy the current ftp  
site directory directly on my server?
