Do or do not use Ruby on Rails Associations [closed] - ruby-on-rails

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am new in RoR , and I wanted to design a web based system. I want to know , if we don't use association in RoR , do happen any problem in system?
Please help me and explain me what problem could be happen in such a system.
thanks

The associations that Rails provides you gives some methods that would make your querying simpler, more readable, maintainable and effective.
Try writing two versions of a Customer-Orders application and then Customer-Order-Supplier 1) with associations and the other without and perform some different type of queries and see the beauty of queries where associations was exploited. From the queries executed you can also see the time they take from the Rails log. Then go into some more complicated examples to delve deeper. You can find some simple examples to start with in the Rails guides.

Related

property web builder app [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have been working on the Propertywebbuilder app on Heroku.
I am looking for help on how to:
edit the html, so i can add an item to the footer.
I would also like to know how i can add more functionality to the app.
it is built with Ruby on rails.
here is the link to the app: PropertywebBuilder
I have deployed it on Heroku and have been playing around, but would like to learn how to improve and add things to it.
many thanks
You need to learn about Rails no one is just going to code for you, unless you're paying them some serious money at least.
The two best resources that helped me learn Ruby on Rails are below. The first is a free book by Michael Hartl https://www.railstutorial.org/book he also has some screencasts but you have to buy those.
the second resource was a company called the Pragmatic Studio that I actually learned about from reading Hartl's book. https://pragmaticstudio.com/ they offer a low cost Rails I and Rails II course that is extremely good. It got me up and building web apps quickly.

Reusing code from Hartl Rails Tutorial [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I've almost completed Michael Hartl's Rails Tutorial. Absolutely loved it, and loving what I've learnt about Rails.
It occurred to me, that I could reuse most of what we've done for the other app ideas that I have. We have great user registration, authentication, security and testing. It would be 'straightforward' to modify what I have here for other purposes.
I just want to ask if this is a standard practice when building new apps (reusing what you already have), and if there any gotchas or things I've not considered in looking to do so?
Loving getting back into coding, and can't wait to get my first idea out into the wild!
These are the standard practices. But of course it all depends on the requirements, based on requirements you need to modify some things.
Also you can refer guides.rubyonrails.org for more.
One thing that I found useful to do is create a base app that includes an Authentication system such as from the Rails Tutorial book, basic templates with a navigation bar and footer and a home and about page. And I connect Bootstrap. I call it Baseapp and when I start a new app I just copy it to a new folder and rename it. Then start customizing it from there.

Making an imageboard with Rails, what controllers to add? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am making my first RoR application and I am a bit confused with planning it out ahead of time.
It will be an anonymous imageboard (like 4chan) where people can make threads across multiple boards and attach images to their posts. They won't need to register and can post anonymously.
Now I am not sure how to implement it, I am guessing there has to be an admin user who will be able to create new boards and delete threads, right? So far I have planned the following controllers:
PostsController
UsersController (can I define the admin user here or should I make a separate controller?)
ThreadsController
BoardsController
Does this seem okay to you?
Thank you for your time.
Planning ahead of time for everything you will need goes against what Ruby on Rails philosophy is to begin with. Ruby on Rails firmly believes in Test Driven Development or TDD.
In that sense, the tests will actually drive your design, starting from unit tests all the way to functional testing. I.e. don't try to anticipate all controller/models from the start. Try to use TDD to let you help design the system, it is a good practice and if you don't know 100% the path you want to follow, it will help you somewhat make your system a bit more robust because of the test harness.
Try to follow this before you start your application. Good luck.
http://guides.rubyonrails.org/testing.html

Rails best practices [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Can anyone help me with few indication about best way to do few things.
At this point I am in a situation where I have a task(.rake), and the code become so ugly that I need to split it out. So if I will create another file, probably a module with multiple classes and methods or just methods, where should I put the file (libs probably?)? (this file may be used by models as well). Also if I want to do the same or a module?
Any books, tutorials, articles, and opinions are welcomed.
Thank you
Check out the Rails Guides for an introduction - beyond that, there are many different [opinionated] resources on the matter, ie:
Railscasts

Where to begin when developing a Rails app [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am a beginner at web development and wanted to know where to begin when developing a web application. More specifically I am using RoR and wanted to know is there a particular stack developers start with for instance would it be better to start developing models or views? Or do I have the wrong approach all together.
This will guide you through installation and 'hello world' in rails.
http://guides.rubyonrails.org/getting_started.html
And I highly recommend this book, if you are serious about rails. Finish it completely. It would give you insights which might take months to comprehend if you are searching only in web.
Book link: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Rails sort of has two "default" stacks, as this blog post helpfully explains:
http://words.steveklabnik.com/rails-has-two-default-stacks
You'll see that mr. Klabnik also has some thoughts about the difficulty this creates for new developers. I'd recommend not worrying too much about all the different tools that are available to you at first. Wait until you have a problem or are experiencing some pain and then find a tool to solve that problem. Before that, just jump in and learn as you go. Or at least, that's how I'd approach it, but people learn differently!

Resources