loading...

Struggle with merging front-end and back-end in rails.

github logo ・1 min read

Hello dear community I hope you had a great weekend.
As new developer in rails I got catch up fast with some back-end like authenticating user/admin and creating a functional crud with scaffold.

But I am struggling with merging the front-end with the back-end. The front-end was submitted to me by another developer and I am having some trouble with the html elements converting them into erb(elements) and giving them the right style.
What kind of learning source would you suggest me for this struggle of mine.

Extra questions:

  1. Would be better to use the default rails forms or to use the simple_form gem?
  2. Can I create views without controller and render the views of other controller in that view?
  3. Is possible to send data to enum by button selecting inside the form.

Thank you, <3.

twitter logo DISCUSS (1)
markdown guide
 

Welcome!

Question 1 : I think this is a difficult question to answer and depends on how you will be creating your front end. If you plan to use a CSS framewok like Bootstrap or Fomantic then personally I perfer to stick with the default and wrap my layout around the erb form tags. If you don't plan to use a css framework then simple_form_gem will save you some typing and make your form more usable but it is not absolutely necessary.

Question 2 : I'll leave this question to others as I am sure I will get it wrong. (My belief - views require a controller. However, what is the problem if the views you wish to render are part of the controller that will be rendering them? What you suggest is going against the heart of Rails and Rails is super opinionated)

Question 3 : You'd need to provde much more detail in order for people to help you with this question - suggest creating another post with just this question and include a lot more detail of what you're looking to achieve.

Classic DEV Post from Dec 7 '18

10 Great Web Development Learning Project Ideas

The best way to learn web development is to find a project that will push you f...

Ardit Daku profile image
I am a developer. Looking to expand my knowledge and experience professionally and create new connections.

dev.to now has dark theme. 🌝

Go to the "misc" section of your settings and select night theme

P.S. It's the best move you can make for your dev career.