Tag: forms

  • Uploadify – Limit to One Upload Only

    Hey everyone, Just a quick post detailing how to limit uploadify to a single file. Simply add the following settings to your uploadify initialisation: multi: false queueSizeLimit : 1 uploadLimit : 1 $(document).ready(function() { $(‘#file_upload’).uploadify({ ‘swf’ : ‘Html->url(‘/uploadify/uploadify.swf’);?>’, ‘uploader’ : ‘Html->url(‘/uploadify/uploadify.php’);?>’, ‘cancelImg’ : ‘Html->url(‘/webroot/uploadify/cancel.png’);?>’, ‘folder’ : ‘Html->url(‘/extraz/uploaded_by_all_users’);?>’, ‘auto’ : true, ‘buttonText’ : ‘Browse’, ‘multi’ :…

  • POST http://192.168.1.3:3000 406 (Not Acceptable) – AJAX with Ruby on Rails

    Just a quick post on an error I ran into today when trying to create an AJAX image upload with Ruby on Rails. When submitting an AJAX form I received the following error: POST http://192.168.1.3:3000/uploads 406 (Not Acceptable) It turns out that there is a fairly simple (and admittedly obvious) solution. Ensure that your controller…

  • Popover Function – Twitter Bootstrap

    Just a quick post on how easy it is to implement a popover with twitter bootsrap: JavaScript: //Create tooltips for login/signup forms function create_tooltips(){ //Create vars var titles = [‘test title’] var contents = [‘test content’]; var fields = [‘#user_email’]; //Loop through each field and assign tooltip for(var i = 0; i < fields.length; i++){…

  • undefined method `merge’ for 5:Fixnum – Hidden Field

    Just a quick post on an error I ran into today while using hidden fields: undefined method `merge’ for 5:Fixnum 27: 28: ‘button’ %> 29: 30: 31: 32: Thankfully this is an easy fix, simply amend your code as follows: ‘button’ %> @upload.product_id %> And that’s all there is to it, let me know if…

  • Create Button which does not Submit – Ruby on Rails

    Just another quick post – how to create a button which does not submit a form when it’s clicked: ‘button’, :onclick => ‘alert(‘Button not Submitted – Hopefully!!!!’), :class => “my_class” %> Let me know if you have any problems.

  • Submit form_for to Custom Action – Ruby on Rails

    Just another quick problem I ran into with rails this afternoon – how to submit a form_for to a custom action. Luckily there’s quite a bit on how to do this in the documentation, my solution ended up as follows: url_for(:controller => ‘feedbacks’, :action => ‘leave_seller_feedback’) do |f| %> Just substitute your form_for tag with…

Create a website or blog at WordPress.com