Search Results

Search found 2 results on 1 pages for 'fcastellanos'.

Page 1/1 | 1 

  • image_to_function in Rails

    - by FCastellanos
    I have this method on rails so that I have an image calling a javascript function def image_to_function(name, function, html_options = {}) html_options.symbolize_keys! tag(:input, html_options.merge({ :type => "image", :src => image_path(name), :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};" })) end I grabbed this code from the application helper of the redmine source code, the problem I'm having is that when I click on the image it's sending a POST, does some one know how can I stop that? This is how I'm using it <%= image_to_function "eliminar-icon.png", "mark_for_destroy(this, '.task')" %> Thanks alot!

    Read the article

  • Rails and MongoDB with MongoMapper

    - by FCastellanos
    I'm new to Rails development and I'm starting with MongoDB also. I have been following this Railscast tutorial about complex forms with Rails but I'm using MongoDB as my database. I'm having no problems inserting documents with it's childs and retrieving the data to the edit form, but when I try to update it I get this error undefined method `assert_valid_keys' for false:FalseClass this is my entity class class Project include MongoMapper::Document key :name, String, :required => true key :priority, Integer many :tasks after_update :save_tasks def task_attributes=(task_attributes) task_attributes.each do |attributes| if attributes[:id].blank? tasks.build(attributes) else task = tasks.detect { |t| t.id.to_s == attributes[:id].to_s } task.attributes = attributes end end end def save_tasks tasks.each do |t| t.save(false) end end end Does anyone knows whats happening here? Thanks

    Read the article

1