LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-22-2016, 09:14 AM   #1
ttiihone
LQ Newbie
 
Registered: Jan 2015
Posts: 4

Rep: Reputation: Disabled
Question Re-building Rails SQLite3 database => Links stop working


Hi there. I'm a newbie to RoR but I managed a year ago to put up a Rails site at: www.rockworksstudio.fi. Click WEB-STUDIO LOGO on that page!

I'm trying to continue from where I left off year ago and I have some issues (probably minor and easy to You) on building up / updating my SQLite3 database file /db/development.sqlite3.

I managed to do it year ago somehow but I have no clue about that anymore. I just know that the TEXTS on that website of mine (behind those links at the bottom area of the page) come from that development.sqlite3 file.

Also I'm confused about the contents of the routes.rb file - sample of which is below:

Code:
    ...
    get 'page/show'
    get '/Etusivu' => 'page#show', :id => 1, as: 'etusivu'
    get '/Esittely' => 'page#show', :id => 2, as: 'esittely'
    get '/Palvelut' => 'page#show', :id => 3, as: 'palvelut'
    get '/Galleria' => 'page#show', :id => 4, as: 'galleria'
    get '/Linkit' => 'page#show', :id => 5, as: 'linkit'
    get '/Tarjous' => 'page#show', :id => 6, as: 'tarjous'
    get '/Palaute' => 'page#show', :id => 7, as: 'palaute'
    get '/Forum' => 'page#show', :id => 10, as: 'forum'
    root 'page#show',  :id => '2'
    ...
So those Routes are for the links at the bottom of the website - like a link with ie. id 3 points to the PALVELUT (services) content (that is loaded dynamically inside the text area in the middle of the webpage).

But I cannot remember how I have used this "id => *" thing to route the links to the right text content, since even if the website works now (somewhat) I cannot find the original text contents from anywhere. Nor know how to edit/enable this ID's..

Only the development.sqlite3 file has those texts among the code, but I can't remember how I originally got them there. With some kind of an SQLite3 editor?? I don't remember...

Here is a sample from the application.html.erb file:

Code:
    ...
    <div class="wrapper-content">
    <div class="content">
    <%= yield %>
    </div>
    </div>
    ...
...so this <%=yield %> thing there.. I'm not sure but I suppose it fetches ALL the content targeted inside that inner DIV also from that database? At least I cannot find even the original data from anywhere.. No .erb files nor nothing.. Yeah, I know; pathetic!

This bad memory really is a drag.. I truly hope that You can help me! I will post whatever You need more info about.

Thank You.

PS. I tried "out of cold" just to remotely execute the command "rake db:reset db:migrate" but it only rendered those "id => 3, 4, 5 etc." links in ROUTES.DB file broken (got the routing error) so this RAKE command seems not be able to build the database as before, since I guess there must be some original files missing or..? I just don't remember/know. :'(
 
  


Reply

Tags
database, ruby, ruby on rails, sqlite3



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to import .txt file into sqlite3 database using C API? Newbie89 Linux - Newbie 3 05-06-2013 04:32 AM
sending queries in sqlite3 database via c API batman4 Programming 1 09-06-2012 12:58 AM
confused about how to get Sqlite3 working with Wordpress 2.9.2 kevinandrews Linux - Software 1 03-21-2010 04:10 AM
LXer: Speed Up DPKG With TDPKG (Using A Tokyocabinet Or Sqlite3 Database) LXer Syndicated Linux News 0 03-17-2010 01:11 PM
Loop or check SQlite3 database continuously, when query found run script for first 3 Techno Guy Linux - Newbie 3 09-27-2009 07:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration