Rails and jQuery Mobile: -


i have desktop version mobile version (currently not fully-functional) of project i'm working on.

for desktop, can render partials , replace dom objects quite easily:

'controller.rb'

def func     @blah = "hey"     @button_label = "button"     respond_to |format|         format.html         format.js     end end 

'_func.html.erb'

<%= blah %> <%= button_to @button_label, {:controller => "controller", :action => "func"}, :method => "put", :remote => true, "data-role" => 'button' %> 

'func.js.erb'

$('#camera_container').html("<%=j render 'func' %>") 

the above code doesn't function on desktop. have separate mobile section, code changes not affect desktop, but controllers shared.

of course, there's button loaded action points func function in controller.rb, fails "replace itself."

the above snippets work desktop version using standard jquery. jquery-mobile, receive page loading error. now, feel has buttons not being enhanced , fact i'm wanting replace 1 button different button (at very, least).


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -