web applications

How to create a new nested attribute form for only new records in a has_many relationship using simple_form, well according to this stackoverflow http://stackoverflow.com/questions/14884704/how-to-get-rails-build-and-fields-for-to-create-only-a-new-record-and-not-includ I was trying to create a new records using nested attributes the problem with that solution it is that if the...

First thing first: Don't forget to setup the environments in my case for example: config/environments/development.rb [ruby] # mailer defaults config.action_mailer.default_url_options = { :host => "localhost:3000" } [/ruby] config/environments/production.rb [ruby] config.action_mailer.default_url_options = { :host => 'elh.mx' } [/ruby] And now let's add the helpers If you are just using the Rails you can do something like: [ruby] module MailersHelper def host_url_for(url_path) root_url.chop + url_path end end [/ruby]

Hello Guys, In this post I'm going to start putting all about queries in rails, so if you find any interesting query let me know and I can put it here, so let's get right to it: Something that I found really useful to understand how the joins works is using this image: If you want to retrieve all the orders that contain more than 2 shipments (Using Spree models) [rails] # this is using inner joins buy default from rails Spree::Order.joins(:shipments).group("spree_shipments.order_id").having("count(spree_shipments.id) > 2") [/rails]

Actually it is pretty straightforward you just have to download and use ngrok(it's free): [program] https://ngrok.com/ [/program] In my case I'm using a rails application so I just need to: [shell] # run my server in localhost rails server # at this moment it is available in http://localhost:3000 by default # if you want...