Understanding Ruby Rendering - mysql

I am very new to ruby on rails and I am using Ruby version 1.9 and its newer syntax.
I have managed to create a small application where I store statistics in 1 large database table. This table can be viewed and edited with no problems via rails.
Now, I am trying to add several different mini views of this table to the Home page, Where I might list the top 10 users by upload then download.
I have successfully created the 1st for upload, is there away I can use the same code with different query options.
Are there any good tutorials in this area?
Is it relatively easy to add graphs from the same table on to the home page?
Is it possible to make the homepage refresh when ever a change occurs in the database table?
I know I am probably asking very basic questions so any pointers to good tutorials or books would be of great help.

Read this tutorial on basics how to render templates in ror.
http://guides.rubyonrails.org/layouts_and_rendering.html
http://api.rubyonrails.org/classes/AbstractController/Rendering.html
For chart you can use this, github.com/ankane/chartkick
Page should refresh when any changes detected in database, for that you can visit ActionController::Live of rails casts.
http://api.rubyonrails.org/classes/AbstractController/Rendering.html

For Rails Tutorials you can find out these
http://www.tutorialspoint.com/ruby-on-rails/
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Coming to Charts you can use gruff gem it is very easy to implement and for dynamic charts you can go for highcharts
http://www.highcharts.com/
https://github.com/topfunky/gruff

Give this a try.
The Rails View: Create a Beautiful and Maintainable User Experience
- by John Athayde and Bruce Williams
http://pragprog.com/book/warv/the-rails-view

Related

Going from webpage to website

I have been coding html/css for some time now, and I've gotten to be proficient at coding single webpages, but I can't figure out how to code a website. Some questions I have are:
Do I need to buy a domain if I want to build a website (for practice)
Are their special things I need to know (such as special tags) that I wouldn't have learned from coding just a single page?
Should I learn how to use a grid if I am coding multiple pages?
You may want to first decide what kind of back end you want (the server side code that builds and delivers the pages) I strongly recommend rails, and a react.rb.
You do not need a domain name.
A great way to start is to use a service like cloud9 which is free, and will get you going in no time. Cloud9 will do a one button setup of a rails environment and get you going.
Another approach is to begin using react.rb and just expand your skill set from the front end towards the server. The react.rb tutorial creates a simple chat application and you can do this all with the tools your already have. Once you have mastered that you can set up a simple rails server and start adding server side persistance (saving data on the server.) This is the approach I recommend, but full discloure: I am one of the leads on the react.rb project so I am very biased.
Well, you can build simple to wonderful STATIC websites from HTML/CSS but if you are talking about some serious web development then you will need to learn a server side scripting language. Most of the websites these days are database driven serverside webpages. There are many serverside programming languages and tutorials for the same out there.
I suggest you start with PHP (for scripting language) and MySql (for database)
Again, the choice of language is totally upto you.
Then you would need to learn about setting up a server on your local computer. For this you will need to learn about (x)-AMP. This would be WAMP, XAMP, MAMP depending on what OS you are using.
If you are only needing to develop a simple CMS website, then there are alot of CMS framework which you can go for, which will not require much of coding.
It seems as if you are looking to connect multiple pages to the same website, so you can navigate between pages. And it seems that you want to practice with local files. If that is the case, you need to first create a local folder for your website and use the a tag in your html files. Inside the a tag, you will need to include an href with the url to your other page. A link to another html page that is saved in the same folder as your original will look like this:
New Page
You will want to use external CSS and JavaScript files to keep all of your pages in the same format.
http://www.w3schools.com/html/html_links.asp
http://www.w3schools.com/tags/tag_link.asp

Swift and ruby on rails

I am creating an online game with ruby on rails and I would like to use the same login and database on my swift application.
For example If I would to create an account on the website I would be able to login, view, and edit my account on the swift application. It would also update for the website or rails application as well. How would I do this?
I would recommend that you look into breaking this down into parts. For example, do you have the login working on the web portion (rails)? If so then you can begin to try to get it to work on the iOS side. Next I would recommend you look into POST and GET requests as a basic way of talking to a back end. Once you have gotten simple apps to work with that then you might have a better idea of the path that lies ahead.

Initializr Bootstrap. Knowledgebase. How to create and edit content?

I am in the process of creating a knowledgebase website for my office and I find bootstrap pretty awesome. Now, people at work, which may not be HTML savvy, will be creating new articles and then posting them to this knowledge base.
Is there something you can recommend that would allow such type of user to create a document on somthing similar to Microsoft Word but web based and then publish?
Or do I have to write it from scratch?
Thanks for any help.

how to use facebook credentials to log in to my native mobile web application

im doing a web base mobile using jquery and html and using sqlite database for log in. right now im struggling with sqlite database log in so im thinking of an alternative like using facebook credentials as a means to log in in my native app is this feasible if yes can anyone point me to right track?can someone give sample code im new in this so sample code with be helpful
I think your are searching for this:
https://developers.facebook.com/docs/facebook-login/
Samplecode will need more specification since you need to know if you will use a js-libary or for example go through the process manually.
If you need help on a specific problem feel free to ask with more specifications.

Mobile Optomized Websites - Databases

I want to create mobile applications for property and jobs directories. I can create basic application frameworks using BT (therefore my programming skills are very limited) but my main issue is trying to figure out the best way to incorporate the search function and directory databases in the apps. The companies I plan to work with already have these search functions and databases incorporated in their website. I would like the solution to be as simple and require as little maintenance as possible.
Therefore I think the best way around this would to be have the apps link to a mobile optimised version of the websites. My question is, what is the simplest and most low cost way to do this?
Is there any software program or application that can be used to convert these websites to mobile optimised versions or will these be big builds with a lot of custom coding involved?
I would like a solution that would work with the website backend and pull data, therefore anytime a listing is added, the mobile version would automatically update..
Perhaps a WebView is what you are looking for - you can display web components inside your application.
There is a nice tutorial here:
http://developer.android.com/guide/webapps/webview.html
Why not ask your companies DBA or webmaster to output JSON endoded query results. then you can use your mobile code to read the json data (plenty of Stackoverflow examples).