I just want to hide the edit button without excluding the :update action. I am creating a custom edit button which is shown depending on the condition for that record, using the inbuilt edit functionality. Excluding the action, removes the capability to use edit in custom area. Please suggest
Asked
Active
Viewed 560 times
1 Answers
0
After you generated the controller (including the :update
action), just remove the button from your app/views/<controller>/<page>.html.erb
file(s).
Note: In these same files you can add your custom button when it is finished.

Veger
- 37,240
- 11
- 105
- 116
-
I am doing it for Rails 1.2.3 where there are files created separate – Priya Saini Jun 05 '12 at 10:07
-
Rails 1.2.3 uses `app/views/
/ – Veger Jun 05 '12 at 13:58.rhtml` instead I believe. But the rest stays the same: just replace the original Edit button with your custom button in these files. -
But in 1.2.3 there are no .rhtml file created. – Priya Saini Jun 06 '12 at 10:41
-
Maybe you could update your question by providing some additional details on the generated content, as you are using quite an ancient Rails version and I (and supposedly other people as well) do not know what was generated then? – Veger Jun 06 '12 at 10:53
-
I agree its pretty ancient but i have no choice. When generating scaffold in 1.2.3 it just creates the controller with active_scaffold :abc do |config| .................end. No views are created by default. Helpers files are also there. – Priya Saini Jun 08 '12 at 04:13