On 25 October 2015 at 12:59, Deepak Sharma <deeky.sharma@gmail.com> wrote:
> In my app I have dashboard part where all major function will perform,
> besides that I have few scaffolds (question, performance etc) which I
> want to display in that dashboard. I'm little confused what will the
> best practice of doing this.
>
> 1) Make partial and then render that partial
> 2) By using content_for and then yield it
>
> It sounds silly but I have little confusing in above two points too.
>
> If I choose first option then how do I move from one scaffold to
> another (dashboard UI / content remain unchanged only scaffold part
> will effect)
The usual way to do this would be by rendering partials. You can
render different partials dependent on the context. Alternatively,
instead of rendering the scaffolds as partials from the dashboard,
render the dashboard as partials from the scaffold. Often this is the
simpler approach.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtSBWBmiU22TUkOHHj56PvOzY%3DaiDZgsjoYaJO%2BLcy5Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment