Hi guys,

Pardon for my newness to Rails and javascript jargon and things, I'm
having a problem displaying uploads using jquery.media.js.

jQuery(document).ready(function() {

var path = '/uploads/<%= @myfile.filename %>';


$('.container').html("<a class='media' href='" + path +
"'>stuff</a>");

jQuery('a.media').media({
width: 400,
height: 300
});
});

So when I change the path to a static URL it works but not with this
dynamic fanciness you see above. The uploader is fine and I'm able to
point to one of the uploads and it works. Maybe its a syntax thing? I'm
not sure what other kind of code I need to post but anyways, I'd love
for some tips or feedback. Thanks in advance! :)

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Javier Quarite at Jan 6, 2012 at 9:24 pm

    On Fri, Jan 6, 2012 at 4:01 PM, Brittany L. wrote:

    So when I change the path to a static URL it works but not with this
    dynamic fanciness you see above. The uploader is fine and I'm able to
    point to one of the uploads and it works. Maybe its a syntax thing? I'm
    not sure what other kind of code I need to post but anyways, I'd love
    for some tips or feedback. Thanks in advance! :)


    You mean that this:

    var path = '/uploads/<%= @myfile.filename %>';

    is not working? does your file ends in js.erb?


    Javier

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Brittany L. at Jan 6, 2012 at 9:32 pm

    Javier Quarite wrote in post #1039785:
    On Fri, Jan 6, 2012 at 4:01 PM, Brittany L. wrote:



    So when I change the path to a static URL it works but not with this
    dynamic fanciness you see above. The uploader is fine and I'm able to
    point to one of the uploads and it works. Maybe its a syntax thing? I'm
    not sure what other kind of code I need to post but anyways, I'd love
    for some tips or feedback. Thanks in advance! :)


    You mean that this:

    var path = '/uploads/<%= @myfile.filename %>';

    is not working? does your file ends in js.erb?


    Javier
    Nay, it acts like it's querying that path too early and is getting
    nothing but media.js does do what it's suppose to do just minus the
    media file. And I'm working in.. .rhtml.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Javier Quarite at Jan 7, 2012 at 12:09 am

    On Fri, Jan 6, 2012 at 4:31 PM, Brittany L. wrote:

    Nay, it acts like it's querying that path too early and is getting
    nothing but media.js does do what it's suppose to do just minus the
    media file. And I'm working in.. .rhtml.
    I thought that code were on a separate file
    have you tried using link_to inside the html? in order to avoid that path
    variable..

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 6, '12 at 9:01p
activeJan 7, '12 at 12:09a
posts4
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Brittany L.: 2 posts Javier Quarite: 2 posts

People

Translate

site design / logo © 2021 Grokbase