0

I am new to rails. I have created controller and able to see changes in http://127.0.0.1:3000/.

How to create Models in Rails and pass data from models to controller.

2

1 Answer 1

2

If you need to access a controller variable from a model it generally means your design is wrong because a controller serves as bridge between view and model (at least in Rails), controller gets info from models, models shouldn't know anything about controllers, but if you want to do it anyway. For your first question you can simply create models in rails as rails g model MODELNAME g as short of generate

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.