How to popup 'Edit' window instead of load a 'Edit' page?
I am currently implementing the 'Edit' feature of CRUD functionalities. I have a link which will call the 'edit' function in CarsController. The link in view is:
%td
=link_to(t("car.edit"), edit_car_path(car))
When user click the link, it goes to the 'Edit' view page (edit.html.haml):
=form_for(car)
...
...
Things are fine in this way. But, if I want the feature that when user click the edit link, there is a popup window to show the 'edit.html.haml' page, how to implement?开发者_JAVA技巧 I mean how to popup the edit page instead of load the edit page?
(I am using Rails 3 which has deprecated the :popup
option of link_to
)
If all you want to do is open the form in a new window, you can set the link's target to "_blank":
%td
=link_to(t("car.edit"), edit_car_path(car), :target => "_blank")
精彩评论