I am trying to do something in Rails and will admit that I'm no genius programmer, but I'm attempting to learn.
I want to create a database with user-generated entries of no specific number. The best example of what I am trying to do can be illustrated by twitter. I assume every time the user adds a new tweet it adds a row to the users tweet database.
Can anyone point me in the right direction to find resources to help me do this?
Thanks!
Teach me to code has a series on creating a Twitter clone in Rails. That might be a good start.
This is a very broad question. Have you tried some of the Rails tutorials? The main Ruby on Rails website has recently put up a bunch of new guides that you might want to start with.
Related
I'm a pretty big RoR novice but I've had a lot of problems with finding out even where to begin.
I'm looking for any tutorials or examples of apps that lets a user fill out a simple form in ruby, takes that information, redirects to another page, and posts the information. The user would be able to share that unique link with others, which shows that information.
I've taken a look at various gems such as Formtastic and Simpleforms but the tutorials on Railscast are outdated and it's difficult to get working. I believe it's because I'm on Rails 3.
I'm pretty lost here and if anything can just prod me in the general direction of where to start / give me general strategy of how I should tackle this, it'd be greatly appreciated. This seems incredibly easy but I'm making it harder for myself than what it is.
I'm actually looking to take an intensive RoR course in a few weeks but I need to get this simple MVP app done (it'll include video by nimbb API) for a deadline... so while I should definitely be putting in the effort to learn rather than cheat and drift, your help this time around would really be great :)
To a large extent this functionally is baked into rails. The simplest way to do this is without any extra gems (besides the default ones):
In your terminal run:
rails g scaffold form name:string message:text
Then the user can go to example.com/forms/new and enter their info. Once they submit the form rails auto redirects them to the view page for that new data. The URL of that page which will be something like /forms/n where n is some integer is the link to share.
If your struggling with rails concepts I would look at the rails guides, especially: http://guides.rubyonrails.org/getting_started.html
I'm still learning rails but want to be sure I'm heading in the right direction. For several of my models I want to let a list of users know that updates have been made when a new record is created for example. I'd like to tie this to an email and in-app notification(doesn't need to be AJAX), next page refresh is fine.
I've been reading up on observers some and I think that's what I want but they seem somewhat controversial based on the blogs I've read. Services like Pusher seem to be overkill for my needs.
Would this be a good solution for this scenario? Also, can anyone point me to some example code that I could emulate?
Thanks!
Check out Rails Cast if you are trying to learn. Best free code base I have seen. Also check out this book another great learning tool. Agile Web Development with Rails (2nd edition).There might be some newer ones out but I have not checked.
I've been trying to allow for tags to be placed on posts so that I could partition them into different sections of my app. I've looked through various gems and have found that acts_as_taggable_on seems to be the most popular one. After various attempts of implementation from the examples in the github of the gem I have not been able to successfully use it. I've searched extensively for a tutorial on implementation but have found none and was hoping someone would have one for such a thing. I'm sorry for the simple question as I am still relatively new to programming.
Railscasts now has an excellent tutorial on acts_as_taggable.
This is also a nice and simple text intro on how to get it working.
There are a number of tutorials that are just fine. The one mentioned in the previous answer is a good one.
One point that is not obvious to someone new to the RoR world is that there is no actual column in the database for the tags on the target table. I have seen many folks add a "tags" column to their database. No need for that at all and it just confuses things.
When you add the "acts_as_taggable_on :tags" to the model it becomes a virtual column (I know its not a RoR way to express this but if you have a database background its easier to think this way).
If you are going to require that tags have owners follow the example on how to get an objects tags carefully. You can only get that objects tags via "tags_from". You will get a null if you try a simple tags_list.
Hope this helps
I'm curious to learn Ruby and Ruby on Rails. I have previous experience with PHP and some basic C/Objective C and Java.
I have done a couple of 'Get started with Rails' tutorials and want to try do create a complete site now. I do have some questions.
Is the entire website an app? I mean, sure, the simple 'blog-with-comments' examples fit in a single app. But what if you want more? Say, a forum, a blog, community, shop, task manager and so on (only random examples here... :) ).
Should I split these things into different 'apps' or not? I would still need them to communicate with each other and share user data and so on...
Any ideas?
Regards
Linus
In general, your core competency as a rails app -- that which you provide the most value for your users. You can then supplement from there, so your support section might be GetSatisfaction and live on support.yourdomain.com.
Your online shop could be a link to your shopify page at shop.yourdomain.com, etc.
Does anyone know if there is a Rails gem/plugin/tutorial that shows how to create a Badge/Achievement system similar to what stackoverflow uses.
Thanks.
You might also want to try the achievements gem: https://github.com/mrb/achievements
It's based on Redis, so you'll need to get that working first. Basically, you define a bunch of achievement contexts (pages viewed, messages sent, etc.) along with multiple levels if necessary. Then, you increment your value appropriately upon certain events, and you can then check if the achievement has been reached.
This link also has a relatively detailed explanation of the thinking behind a badge/achievement system: RoR Achievement System - Polymorphic Association & Design Issues
check out https://github.com/paulca/paths_of_glory
I think it's less a framework but a design question. If you know how to build it in an object-oriented way, you'll eventually know how to build it in Rails too.
If you're a Rails newbie, check out the Rails Guide on "Active Record Associations" and try to identify the models and the associations of your "badge/achievment system".
Besides that: No, I don't know of any turnkey-gem/plugin/tutorial that would help you build such a system.
There is also Gioco, which I haven't yet tried:
http://joaomdmoura.github.io/gioco/