Hello All, i want to integrate light box ajax feature in my web app so that any idea about it. -- Posted via http://www.ruby-forum.com/.
Wap Addon wrote:> Hello All, > > i want to integrate light box ajax feature in my web app so that any > idea about it.It would be better if you put down what you have done so far and where exactly you are encountering issues or atleast the procedure to recreate the issues you are facing.... without any of these, it sounds as if you want some one to provide you an entire working code... -- Posted via http://www.ruby-forum.com/.
ok <html> <head> <title>pages addon</title> <%= stylesheet_link_tag ''default'' %> <%= stylesheet_link_tag ''lightbox'' %> <%= javascript_include_tag ''prototype'' %> <%= javascript_include_tag ''lightbox'' %> </head> <body> <div> <h3>Listing pages</h3> <%=lightbox_link_to image_tag ''Christmas Skype.PNG'', :class => ''lbOn'' %> <table> <tr> <th>Title</th> <th>Body</th> <th>Uname</th> </tr> <% for page in @pages %> <tr> <td><%=h page.title %></td> <td><%=h page.body %></td> <td><%=h page.uname %></td> <td><%= lightbox_link_to ''Show'', page, :class => ''lbOn''%></td> <td><%= link_to ''Edit'', edit_page_path(page) %></td> <td><%= link_to ''Destroy'', page, :confirm => ''Are you sure?'', :method => :delete %></td> </tr> <% end %> </table> <br /> <%= link_to ''New page'', new_page_path %> </div> </body> </html> click on show lightbox_link_to then open box but i got error ActionController::InvalidAuthenticityToken in PagesController#1 ActionController::InvalidAuthenticityToken in this 1 is id from page 1 -- Posted via http://www.ruby-forum.com/.
may be you could try this. put it in your controller. Here i assume your view is for the action ''my_action'' protect_from_forgery :except=>[:my_action] let me know how it goes. -- Posted via http://www.ruby-forum.com/.
Rails List wrote:> may be you could try this. put it in your controller. Here i assume your > view is for the action ''my_action'' > > protect_from_forgery :except=>[:my_action] > > let me know how it goes.i follow ur suggestion but same problem as above ActionController::InvalidAuthenticityToken in PagesController#1 ActionController::InvalidAuthenticityToken i am give procedure scaffold in page in my project - in index include lightbox.js, prototype.js, lightbox.css -then i can use light box below way <td><%= lightbox_link_to ''Show'', page, :class => ''lbOn''%></td> <td><%= lightbox_link_to ''Edit'', edit_page_path(page), :class => ''lbOn'' %></td> show and edit both r inbuild file i want just open through lightbox -- Posted via http://www.ruby-forum.com/.
ok, put this in your controller and see if that works. skip_before_filter :verify_authenticity_token -- Posted via http://www.ruby-forum.com/.
In Application controller Try to comment the line # protect_from_forgery # :secret => ''dasdas5484565asdasda'' I too had a similar type of error when i commented that line it worked.I dont know if this could be a solution for your problem. Any ways lets give a try.