Good way to create model which generates something in Rails
There is a model A
, which have some fields in database and some relationships. Action .create()
for this model doesn't get direct data from user:
- User sets some params at
.new()
form, model generates some data - Render STEP1
- User modifies this data if he wants and runs final generation.
- Result of final generation stores in database and renders to user.
How this scenario can be applied to MVC and Ruby on Rails?
Update
I have a model, namedRoute
and /search
form. At /se开发者_Go百科arch
a user can specify his favorite cities and countries for Route
.
Some half-random generator selects some suitable cities for user, solving TSP
and render it on google map.
This is step 1.
User can further edit this pre-route and click "Continue". The generator should find some suitable places in selected cities.
That's all.https://github.com/search?langOverride=Ruby&q=wizard&repo=&start_value=1&type=Repositories
精彩评论