I need a separate index/view from a scaffold generated table I’ve created. In this view, I have about half of the original scaffold columns, with the intention of a user being able to edit and update two of them. I created a non scaffold controller to generate this view. So, my questions:
1). Is it possible to combine scaffold and non scaffold resources in the non scaffold partial form?
2). Can I use the edit action and partial from the non scaffold controller with update going to the scaffold table?
I suppose in production, this would likely be some sort of authorization system?, but for now, I just want to find out the possibilities. My view/index in the non scaffold controller works, but of course the edit button does nothing. Am I missing something? For now, I’m using Rails 3.0 on Windows 7 if that makes any difference.
Routing in Partial:
<%= form_tag(:controller=> "ravs", :method=> "get", :action=> "edit", :class=> "_dec") %>
<div >
<%= submit_tag(:controller=> "achvrs", :method=> "put", :action=> "update") %>
</div>
<% end %>
This is my routes.rb:
Effcnt::Application.routes.draw do
get "ravs/index"
get "ravs/edit"
get "ravs/_dec"
resources :achvrs
This is the edit action in my non scaffold controller:
def edit
@achvr = Achvr.find(params[:id])
end