I have a ajax call to a controller that checks for authentication, when no authentication exists it sends the call onwards to the signin controller who checks if it is a xhr request. If it is it renders an rjs containing a page.redirect_to to the sig...
Say I need to call a javascript file in the <head> of an ERb template. My instinct is to do the usual:  <head> <%= javascript_include_tag :defaults %> <!-- For example --> </head>   in my application's layout. The pr...
Since I didn't get the expected answer on my last question I'll try to simplify and narrow my question:     How can I build a dropdown-menu that uses AJAX (no submit-button) to call the show action of a certain controller?   The following thi...
Is it possible to change a html tag attribute value from an RSJ template? I know that there is a page.replace_html method, but it is not very useful in my case, since I have lengthy values of various attributes (such as alt, title of an image). What...
Here is code on view in FeesController "show" action template:    <div id="payers_controls">       <%= link_to_remote('New payer',                                :update => "payers_controls",...
yeoman server works fine, but yeoman build looks for my main requirejs file in a strange place and fails:  <WARN> Unable to read "scripts/scripts/main.js" file (Error code: ENOENT). Use --force to continue. </WARN>   It seems to a...
I have the following code in my controller:  File: app/controllers/photos_controller.rb  def show_snapshot_comments     snapshot = Snapshot.find(params[:id])     @photo = snapshot.photo     comments = snapshot.comments.paginate :page => params[:pa...
In Rails' RJS Adapter,  page['id'] // $('id')   accesses an CSS-id,  page['id'].property // $('id').property   a property of it. But how can I access an array index, e.g.  page.select('ul').value_at(2) // $...
I am using RJS in my current project.  I have table rows with data and the last column contains a button, that binds javascript click function.  Now I have to do a AJAX and append newly created row to the table. It works fine. Here is the create.rjs...
How to do I convert an rjs file to js.erb  Just renaming doesn't work in my case   This is my old code(works well with rails 2 app)  page.replace_html(  "overlay" ,    :partial => @path_resolver.resolve_template(                 :tmpl_...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.