SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    First Timer! Looking for some coaching

    Good day!

    I have been given an awesome opportunity and was hoping I could get some well needed guidance! I was handed over a project that my predecesor left unfinished. His job was to create a website for a department here at my university. After discovering he built the site using ror I started to read up on ror. I like what I see so far!!

    I have been giving a task to add a hyperlink on the homepage that links to an .zip file. (software for students to download). I have been opening up a lot of the .rhtml files and looking at the code and was wondering if I am going to have to find the appropriate file, add the html with the file path, and then save changes to get the results I want OR IS THERE AN EASIER WAY TO DO THIS??

    Someone show me the Rails way to do this please!

    Is there a gui or preview of the page that I can just edit like in dreamweaver? I know there are built in functions to ruby that will let me do what I am looking to do however I do not get the whole picture yet.

    Also, is there a particular location in the rails directory that the .zip or .exe (files to be linked to for download) need to be located?

    THANK YOU!
    ps windows guy...but school webserver is a MAC!

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to edit the .rhtml files. Preview = open browser. You can put the .zip and .exe files in the ./public directory.

    First you need to figure out which file is for the home page...

  3. #3
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could someone provide an example of a hyperlink. I think i have the path correct but it still does not seem to be working.. Thank you!

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="path">text</a>
    It might be helpful to read HTML tutorials. There's no way to code an application with Rails without knowing HTML.

  5. #5
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok let me rephrase... I am familiar with html and <a href="path">text</a>

    However the "path" part is killing me.

    1. I do not know the root directory of the site as i did not set it up. Does Rails use a default location?

    2. I have tried tons of combinations of "http:mysite.com/../../../public/file.exe"

    I guess the problem here is that I have to browsing tool to locate the file so it creates the path for me. I am not used to typing out the entire path by hand. Are there any secrets to this.

    I do not believe I am mispelling anything but I will get the directory stucture of the site by the end of the day.

    This is extremely basic for me and I realize most of you are probably thinking this is a joke but i have tried for 3 hours today and it is still escaping me. I am getting pretty frustrated at this point. So any help is appreciated. I will get as much info as I can to help you all get a good idea of what needs to happen.

  6. #6
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha, then your problem is easily solved

    Use relative paths. All relative paths go to ./app/public/.

    Example:
    Code:
    <a href="executables/file.exe">...</a>
    Put the file in ./app/public/executables/file.exe (create the diretory executables first, or put them directly in ./app/public/).

  7. #7
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Outstanding! I will give it a shot tomorrow morning. I really really appreciate all the advice!!

  8. #8
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, what I said is wrong...public is not a subdirectory of app, it's a subdirectory of your application directory, like this:

    Code:
    yourapp/
      app/...
      config/...
      ...
      public/...
    So the files belong in ./public/executables, not in ./app/public/executables.

  9. #9
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2 View Post
    Sorry, what I said is wrong...public is not a subdirectory of app, it's a subdirectory of your application directory, like this:

    Code:
    yourapp/
      app/...
      config/...
      ...
      public/...
    So the files belong in ./public/executables, not in ./app/public/executables.

    It WORKS!! Thanks! I just put the file in public and did <a href="file.exe">

    Thanks so much.... The path was more simple than I expected.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •