Monday, 15 March 2010

rails - how to override default views -


By default, when I ask to / message the Rail Controller, it does

  df index response_to {| Fmt | | Fmt.html} and  

and app / ideas / messages / index.html. ARB

shows that there is a customer whose example to show the platform view (and the change can not be done with CSS only)

I think the solution

  1. to create a directory app / view / # {custom name}, which has the same structure as the app / view , But there are only those views that override the default.

  2. which must be overridden (if not, they should load the default view)

      CUSTOM_VIEWS ["message"] = ["index", "show" "," Edit "]  

    from anywhere in the customer-specific config file

  3. All such actions have to be done in the administration

      to give DIF index feedback. Fmt | Fmt.html Include CUSTOM_VIEWS [parameter [: controller]]. (Parameter [: Action]) #override default app / view / message / index.html with app / view / customname / message / index.html. ARB render "# {customername} / # {params [: controller]} / # {parameter [: action]}" end and end  

Or is there a better / faster solution / plugin to do this?

It should help:


No comments:

Post a Comment