开发者

How to popup 'Edit' window instead of load a 'Edit' page?

开发者 https://www.devze.com 2023-02-07 19:45 出处:网络
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:

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号