Ruby on Rails Thursday, August 17, 2017


3Pillar Global is a full life-cycle software development company. Our teams across the globe help clients design, build and deliver software products that make a difference.
In Romania we have 3 development centers: Cluj, Timisoara and Iasi.

3Pillar Global is searching for Ruby on Rails Developers who will take part in the whole development and release cycle for a complex application that engages the latest technology stack (PostgreSQL, RabbitMQ, AWS included).

We are looking for professionals at Senior/Lead level, as well as at an Intermediate level. 
You'd be working in a close-knit project team comprised of Back-end, Front-end, QA, DevOps professionals, all working in a full-stack atmosphere and alongside our project partners in the US. At 3Pillar, we are passionate advocates of the Product Mindset.Thus we're enabling team members to maximize agility and velocity in the development process as well as understand nuances related to the business logic behind product needs.

Check out the job ads in the following links:

http://careers.3pillarglobal.com/3pillar-job-details?jobId=180a83c1-b9e1-4642-8690-88be20179d32
http://careers.3pillarglobal.com/3pillar-job-details?jobId=b6dad359-235c-4774-aa3e-0c19294c1214

And, of course, please reach out directly should you be curious about certain aspects: cristina.koncsag@3pillarglobal.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4de6ac08-82e9-48cd-a01d-3dae0cf22bcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think you could solve your problem by explicitly writing all modules and moving the file in the appropriate foder, this should solve your autoloading issues. 
For example for Pes::Person::Phone you should do this:

module Pes
   module Person
      class Phone
      end
  end
end

and you need to put this file into pes/person/phone.rb

Il giorno mercoledì 16 agosto 2017 19:21:58 UTC+2, Daniel Faiole ha scritto:
Hi,
I can't seem to find anything on the web regarding this error I found. I don't know if it's something i did wrong or just some kind of bug.

I have 2 engines, named "Pes" and "Iss". "Pes" is the most atomic engine in our project and all other engines will add it as a dependency, it has these models:

Pes::Person
Pes::Person::Phone

The "Iss" engine depends on "Pes" and has these models that inherits from "Pes"

Iss::Person < Pes::Person
Iss::Person::Phone < Pes::Person::Phone

My problem is that, when I call Iss::Person.new, rails gives me an Iss::Person object... Great! But when I call Iss::Person::Phone, rails is giving me a Pes::Person::Phone object... I tried everything, and even when i remove the inheritance from the Iss::Person::Phone model, it still gives me the Pes::Person::Phone object.

Here's some sample code:

module Pes
  class Person < ApplicationRecord
     ...
  end
end

module Pes
  class Person::Phone < ApplicationRecord
     ...
  end
end

module Iss
  class Person < Pes::Person
     ...
  end
end
 
module Iss
  class Person::Phone < Pes::Person::Phone
     ...
  end
end

I'm using rails 4.2.9, but i tried to update to 5.0.2 and it still giving me this bug, I still haven't tried using rails >= 5.1

Also, sorry if my english doesn't make much sense, i'm from Brasil

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d01e323d-bdef-4a6d-8206-5389910d8e47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, August 16, 2017

Hi,
I can't seem to find anything on the web regarding this error I found. I don't know if it's something i did wrong or just some kind of bug.

I have 2 engines, named "Pes" and "Iss". "Pes" is the most atomic engine in our project and all other engines will add it as a dependency, it has these models:

Pes::Person
Pes::Person::Phone

The "Iss" engine depends on "Pes" and has these models that inherits from "Pes"

Iss::Person < Pes::Person
Iss::Person::Phone < Pes::Person::Phone

My problem is that, when I call Iss::Person.new, rails gives me an Iss::Person object... Great! But when I call Iss::Person::Phone, rails is giving me a Pes::Person::Phone object... I tried everything, and even when i remove the inheritance from the Iss::Person::Phone model, it still gives me the Pes::Person::Phone object.

Here's some sample code:

module Pes
  class Person < ApplicationRecord
     ...
  end
end

module Pes
  class Person::Phone < ApplicationRecord
     ...
  end
end

module Iss
  class Person < Pes::Person
     ...
  end
end
 
module Iss
  class Person::Phone < Pes::Person::Phone
     ...
  end
end

I'm using rails 4.2.9, but i tried to update to 5.0.2 and it still giving me this bug, I still haven't tried using rails >= 5.1

Also, sorry if my english doesn't make much sense, i'm from Brasil

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c28574ab-ac6e-438d-a757-f456db800e70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Friday, August 11, 2017 at 8:10:38 AM UTC-4, Walter Lee Davis wrote:

> On Aug 11, 2017, at 2:34 AM, Colin Law <cla...@gmail.com> wrote:
>
> On 10 August 2017 at 13:36, fugee ohu <fuge...@gmail.com> wrote:
>>
>>
>> On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
>>>
>>> On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
>>>> One of my apps drives the others and stores pictures that the others use
>>>> Both apps are on the same server How do i build a link to the image on
>>>> the
>>>> other app?
>>>
>>> You could use image_tag possibly.
>>>
>>> Colin
>>
>>
>> how do i get above / ?
>
> Good point, you will have to arrange the upload to save to a location
> visible to both servers, or accessible via another server, and do the
> download link manually.
>
> Colin

There's many ways to get this to work, and depending on how your server(s) is/are architected, some are more elegant than others.

In one application I built, there are three separate VPS hosts: database, admin, and public. Admin and public have the same NFS share mounted to each of them, with admin able to write to it, and public only able to read from it. The NFS share is defined in my file upload gem (Dragonfly) as the place where files are written. Dragonfly is somewhat unique in how it manages files (everything is proxied through a Rack app, never hosted directly through Apache/Nginx) so this means I don't have to have that NFS directory in the app's public/system/whatever path. But even if I wanted to allow direct httpd hosting of uploaded images, I could do that through the Apache configuration file, by aliasing a folder from /mount/nfs/share/whatever into public/system/images, for example. https://httpd.apache.org/docs/2.4/urlmapping.html#outside

So that's an extreme example, brought about by having these apps on different (quasi-physical) servers. If you were hosting them on different virtual hosts on the same server (real or virtual), then your task is a lot simpler. Forget about the NFS mounts, and just configure your Web server to include the same directory, as above, and ensure that only one app is writing into that folder, and both are sharing a single database, so that the apps don't get confused.

And I've completely overlooked S3 (or any of its various clones), which is sort of a giant share-point in the sky. If you use Fog or another cloud storage adapter, you can treat S3 as you would a local folder, and two or more servers can be configured to use the same S3 "bucket" at the same time. With UUID primary keys, you don't even need to coordinate the databases.

As far as building a link goes, my apps assume that only one app is doing the writing, and the other one is read-only, so they share a database. Building a link is in the normal Rails manner, based on an ID. But if you had two independent apps that didn't share anything, you would need to build a bridge between them. One could advertise the images it has available through an API, and the other could use that API to periodically update a local cache of what images are available, for example, and what their addresses are, and use those directly. You would build an image tag with the src set to //other.host.dom/path/to/image.jpg rather than pretending it was on your local server.

In the end, your solution will depend entirely on what your needs are. In my example above, I needed to support a team of editors, who could write things and add metadata to them and approve them, and a largish audience who were read-only on the things that were complete and "published". You might get some more focused solutions for your problem if you can articulate why you have separated these concerns.

Walter
 
 Different virtual hosts on the same server I need to symlink or set something in nginx.conf?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7a0aa835-14ba-465b-aa53-b2f8fb60d906%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Wed, Aug 16, 2017 at 5:25 AM, S Ahmed <sahmed1020@gmail.com> wrote:
> I know about the post request. Just ensure when it is considered a
> post.xhr? request.

From rack 2.0.3 lib/rack/request.rb:

def xhr?
get_header("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest"
end

This is from Rails 5.1.2, btw. You can find the equivalent somewhere
in the 2.2 source, I imagine 😀

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCtx%2BvukrhGL8pRF5HwXi4mhDU%2BWLMhpjquSiFoRyOo%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I know about the post request.  Just ensure when it is considered a post.xhr? request.  

On Wed, Aug 16, 2017 at 7:45 AM, Norbert Melzer <timmelzer@gmail.com> wrote:
(new XMLHttpRequest).open('POST', 'foo.xml', 'data') via JavaScript should do a POST request. At least according to wikipedia. But Rails 2.2 is quite old, you should prepare to rewrite ;)

S Ahmed <sahmed1020@gmail.com> schrieb am Mi., 16. Aug. 2017 um 04:34 Uhr:
In rails 2.2 there was checks in the code like:

if request.post?
    ...
    if request.xhr?
    end
    ...

end


If a HTTP POST is made, how would also be considered a XHR request?



Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAG2rwuONtt48xRs524uCZ0F8YqL-tgpa-nO8f_%3DWeO_%3DE-UWXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVssauo1C%2B%2B9b9JjRd55kS9Xs%2B6JFDshrffnPqTAjcUhBUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAG2rwuOWb77%2BzY0OrNUVJCD_Fgt%3DzZQAd_xuX0VMXERXMNJt9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

(new XMLHttpRequest).open('POST', 'foo.xml', 'data') via JavaScript should do a POST request. At least according to wikipedia. But Rails 2.2 is quite old, you should prepare to rewrite ;)

S Ahmed <sahmed1020@gmail.com> schrieb am Mi., 16. Aug. 2017 um 04:34 Uhr:
In rails 2.2 there was checks in the code like:

if request.post?
    ...
    if request.xhr?
    end
    ...

end


If a HTTP POST is made, how would also be considered a XHR request?



Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAG2rwuONtt48xRs524uCZ0F8YqL-tgpa-nO8f_%3DWeO_%3DE-UWXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVssauo1C%2B%2B9b9JjRd55kS9Xs%2B6JFDshrffnPqTAjcUhBUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm mounting the uploader on a string  field, :name
In my form
<%= f.file_field :name %>
When the form submits this is what gets logged:

Started POST "/user/pictures/new" for 127.0.0.1 at 2017-08-16 05:27:01 -0400
Processing by UserPicturesController#create as HTML
  Parameters: {"utf8"=>"���", "authenticity_token"=>"rbCey3lEepNFfTK//Jc4/DlvP+BX92eKi1TI2508Q3f7UM+ADD8L39zORKtC9zU3xY3RS2FWKbX6DyIg/x/O+w==", "picture"=>{"imageable_id"=>"436", "imageable_type"=>"PressRelease", "comment"=>"", "name"=>#<ActionDispatch::Http::UploadedFile:0x0000000a230f00 @tempfile=#<Tempfile:/tmp/RackMultipart20170816-11656-q784t1.jpeg>, @original_filename="icecream.jpeg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"picture[name]\"; filename=\"icecream.jpeg\"\r\nContent-Type: image/jpeg\r\n">}, "commit"=>"Create Picture"}
 
Above in the log "name" isn't  "icecream.jpeg" which is what's expected The validation returns:

2 errors prohibited this picture from being saved:

  • Name can't be blank
  • Name translation missing: en.errors.messages.mini_magick_processing_error

I'm confused Anyone can help? Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6b455a9d-f604-48d1-9907-1ad1ae5a1fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, August 15, 2017

In rails 2.2 there was checks in the code like:

if request.post?
    ...
    if request.xhr?
    end
    ...

end


If a HTTP POST is made, how would also be considered a XHR request?



Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAG2rwuONtt48xRs524uCZ0F8YqL-tgpa-nO8f_%3DWeO_%3DE-UWXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I may have a large group of (Devise) users each of whom is a separate Postgres user, e.g. SomePostgresRole01, SomePostgresRole02, etc.

I can successfully do:
      conn = PGconn.connect("localhost", 5432,"","","db_development","SomePostgresRole01","SomePassword")

I cannot find a conn.disconnect method.  Does such functionality exist?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fb161f5b-3386-4474-9046-ebd283b57015%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Monday, August 14, 2017

Bom dia,
Alguém poderia me ajudar com este problema que postei aqui neste fórum?

https://pt.stackoverflow.com/questions/227109/filtrar-campos-select-utilizando-o-valor-de-outros-selects-com-ruby-on-rails

Obrigado.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b788a4d4-271a-4db0-84f0-269d3f6e992d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Friday, August 11, 2017

It seems the uploader has to be mounted even if I'm not uploading but only rendering otherwise I'll get unknown method thumb for my object ?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/17a527db-7f8c-474a-b7bb-dd222bd1e8f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The uploader has to be mounted for proper rendering also? I think the app doesn't understand the thumb method unless the uploaders mounted?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/75193001-a6b6-4401-8897-dbd21a2726ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Friday, August 11, 2017 at 8:10:38 AM UTC-4, Walter Lee Davis wrote:

> On Aug 11, 2017, at 2:34 AM, Colin Law <cla...@gmail.com> wrote:
>
> On 10 August 2017 at 13:36, fugee ohu <fuge...@gmail.com> wrote:
>>
>>
>> On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
>>>
>>> On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
>>>> One of my apps drives the others and stores pictures that the others use
>>>> Both apps are on the same server How do i build a link to the image on
>>>> the
>>>> other app?
>>>
>>> You could use image_tag possibly.
>>>
>>> Colin
>>
>>
>> how do i get above / ?
>
> Good point, you will have to arrange the upload to save to a location
> visible to both servers, or accessible via another server, and do the
> download link manually.
>
> Colin

There's many ways to get this to work, and depending on how your server(s) is/are architected, some are more elegant than others.

In one application I built, there are three separate VPS hosts: database, admin, and public. Admin and public have the same NFS share mounted to each of them, with admin able to write to it, and public only able to read from it. The NFS share is defined in my file upload gem (Dragonfly) as the place where files are written. Dragonfly is somewhat unique in how it manages files (everything is proxied through a Rack app, never hosted directly through Apache/Nginx) so this means I don't have to have that NFS directory in the app's public/system/whatever path. But even if I wanted to allow direct httpd hosting of uploaded images, I could do that through the Apache configuration file, by aliasing a folder from /mount/nfs/share/whatever into public/system/images, for example. https://httpd.apache.org/docs/2.4/urlmapping.html#outside

So that's an extreme example, brought about by having these apps on different (quasi-physical) servers. If you were hosting them on different virtual hosts on the same server (real or virtual), then your task is a lot simpler. Forget about the NFS mounts, and just configure your Web server to include the same directory, as above, and ensure that only one app is writing into that folder, and both are sharing a single database, so that the apps don't get confused.

And I've completely overlooked S3 (or any of its various clones), which is sort of a giant share-point in the sky. If you use Fog or another cloud storage adapter, you can treat S3 as you would a local folder, and two or more servers can be configured to use the same S3 "bucket" at the same time. With UUID primary keys, you don't even need to coordinate the databases.

As far as building a link goes, my apps assume that only one app is doing the writing, and the other one is read-only, so they share a database. Building a link is in the normal Rails manner, based on an ID. But if you had two independent apps that didn't share anything, you would need to build a bridge between them. One could advertise the images it has available through an API, and the other could use that API to periodically update a local cache of what images are available, for example, and what their addresses are, and use those directly. You would build an image tag with the src set to //other.host.dom/path/to/image.jpg rather than pretending it was on your local server.

In the end, your solution will depend entirely on what your needs are. In my example above, I needed to support a team of editors, who could write things and add metadata to them and approve them, and a largish audience who were read-only on the things that were complete and "published". You might get some more focused solutions for your problem if you can articulate why you have separated these concerns.

Walter


Thank you

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5174d55c-2a92-4193-bb6a-385bb0f5519c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Friday, August 11, 2017 at 2:35:10 AM UTC-4, Colin Law wrote:
On 10 August 2017 at 13:36, fugee ohu <fuge...@gmail.com> wrote:
>
>
> On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
>>
>> On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
>> > One of my apps drives the others and stores pictures that the others use
>> > Both apps are on the same server How do i build a link to the image on
>> > the
>> > other app?
>>
>> You could use image_tag possibly.
>>
>> Colin
>
>
> how do i get above / ?

Good point, you will have to arrange the upload to save to a location
visible to both servers, or accessible via another server, and do the
download link manually.

Colin

Thank you

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0682fa00-0833-42ac-8313-4c73517feb8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

> On Aug 11, 2017, at 2:34 AM, Colin Law <clanlaw@gmail.com> wrote:
>
> On 10 August 2017 at 13:36, fugee ohu <fugee279@gmail.com> wrote:
>>
>>
>> On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
>>>
>>> On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
>>>> One of my apps drives the others and stores pictures that the others use
>>>> Both apps are on the same server How do i build a link to the image on
>>>> the
>>>> other app?
>>>
>>> You could use image_tag possibly.
>>>
>>> Colin
>>
>>
>> how do i get above / ?
>
> Good point, you will have to arrange the upload to save to a location
> visible to both servers, or accessible via another server, and do the
> download link manually.
>
> Colin

There's many ways to get this to work, and depending on how your server(s) is/are architected, some are more elegant than others.

In one application I built, there are three separate VPS hosts: database, admin, and public. Admin and public have the same NFS share mounted to each of them, with admin able to write to it, and public only able to read from it. The NFS share is defined in my file upload gem (Dragonfly) as the place where files are written. Dragonfly is somewhat unique in how it manages files (everything is proxied through a Rack app, never hosted directly through Apache/Nginx) so this means I don't have to have that NFS directory in the app's public/system/whatever path. But even if I wanted to allow direct httpd hosting of uploaded images, I could do that through the Apache configuration file, by aliasing a folder from /mount/nfs/share/whatever into public/system/images, for example. https://httpd.apache.org/docs/2.4/urlmapping.html#outside

So that's an extreme example, brought about by having these apps on different (quasi-physical) servers. If you were hosting them on different virtual hosts on the same server (real or virtual), then your task is a lot simpler. Forget about the NFS mounts, and just configure your Web server to include the same directory, as above, and ensure that only one app is writing into that folder, and both are sharing a single database, so that the apps don't get confused.

And I've completely overlooked S3 (or any of its various clones), which is sort of a giant share-point in the sky. If you use Fog or another cloud storage adapter, you can treat S3 as you would a local folder, and two or more servers can be configured to use the same S3 "bucket" at the same time. With UUID primary keys, you don't even need to coordinate the databases.

As far as building a link goes, my apps assume that only one app is doing the writing, and the other one is read-only, so they share a database. Building a link is in the normal Rails manner, based on an ID. But if you had two independent apps that didn't share anything, you would need to build a bridge between them. One could advertise the images it has available through an API, and the other could use that API to periodically update a local cache of what images are available, for example, and what their addresses are, and use those directly. You would build an image tag with the src set to //other.host.dom/path/to/image.jpg rather than pretending it was on your local server.

In the end, your solution will depend entirely on what your needs are. In my example above, I needed to support a team of editors, who could write things and add metadata to them and approve them, and a largish audience who were read-only on the things that were complete and "published". You might get some more focused solutions for your problem if you can articulate why you have separated these concerns.

Walter

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4351B338-862E-48A8-A95D-ADC061730E03%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Thursday, August 10, 2017

On 10 August 2017 at 13:36, fugee ohu <fugee279@gmail.com> wrote:
>
>
> On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
>>
>> On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
>> > One of my apps drives the others and stores pictures that the others use
>> > Both apps are on the same server How do i build a link to the image on
>> > the
>> > other app?
>>
>> You could use image_tag possibly.
>>
>> Colin
>
>
> how do i get above / ?

Good point, you will have to arrange the upload to save to a location
visible to both servers, or accessible via another server, and do the
download link manually.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtYDexSuYV3YF1Vfaq8PZdT0P2XpJg8da-cHWty-6wy6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Thursday, August 10, 2017 at 3:01:06 AM UTC-4, Colin Law wrote:
On 10 August 2017 at 07:50, fugee ohu <fuge...@gmail.com> wrote:
> One of my apps drives the others and stores pictures that the others use
> Both apps are on the same server How do i build a link to the image on the
> other app?

You could use image_tag possibly.

Colin

how do i get above / ?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/571e0067-4829-46ee-83bd-8d5b2d21e97f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 10 August 2017 at 07:50, fugee ohu <fugee279@gmail.com> wrote:
> One of my apps drives the others and stores pictures that the others use
> Both apps are on the same server How do i build a link to the image on the
> other app?

You could use image_tag possibly.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuJyx9ercyVuWMuF6g0uSODzQkUPQmyz4H0fQGGYyGu3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, August 9, 2017

One of my apps drives the others and stores pictures that the others use Both apps are on the same server How do i build a link to the image on the other app?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b75d3393-f0da-47f2-a6dd-28d315a2495b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, August 8, 2017



On Tuesday, August 8, 2017 at 8:26:37 AM UTC-4, Walter Lee Davis wrote:
The order of inclusion in the routes file is important here. If you have:

devise_for :users

[followed by]

resources :users

...then the rake routes command will show you that the `user PATCH` path will be handled by the users_controller. If you have those two in the opposite order, then you will see that `users PATCH` (note the plural) will be handled by the devise_controller, and the path will be named users_registration.

What do you see when you rake routes in your application? You may also need to restrict your resources :users route to just a few actions with the `only: [:your, :actions, :here]` syntax. Also, what does your devise_for look like? I have found that the order of module inclusion can be important.

Walter


> On Aug 8, 2017, at 5:47 AM, fugee ohu <fuge...@gmail.com> wrote:
>
> How do I edit users when i have devise_for :users and resources :users I have a users controller with it's own whitelist and then I can whitelist for devise in application_controller.rb What's the status of the crud users controller and it's whitelist? I've been trying to edit a user but the changes don't take It says user was successfully updated but then when I click edit again nothing's changed
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8931cf8-d7f8-4523-aaa8-ee3fbf4d44b0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Hey Walter Thanks Actually it was some database columns needed renaming but the info you gave me above is pretty good Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c3e88f51-cd1c-4a03-ab7d-52d9134c597f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

cool, congratulations! 🎉


2017-08-08 12:27 GMT-03:00 Jesus Castello <matugm@gmail.com>:
Hello!

I wrote a 3-part series about computer science concepts in Ruby with code examples you can use right away.

Here's are the links for your convenience:


Let me know what you think :)

- Jesus Castello (Ruby Teacher & Mentor)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d6f9eeb5-fb3a-42c5-9da5-62c359e1acb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAK6Fff%2BZgnYeVsWFPtv9wzGKjg3oWOFGdTUothWZCi_ZkNNoBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks to Ruby and Free Software community, I am earning my bread for many years now. I have to do something so that people can learn for free and can possibly start to earn.

On Tue, Aug 8, 2017 at 9:10 PM, nynhex <nynhex@gmail.com> wrote:
Great read, thanks for publishing this! 

On Aug 8, 2017, at 10:31 AM, Karthikeyan A K <77minds@gmail.com> wrote:

Hello People,

Have fixed some broken links for https://mindaslab.github.io/I-Love-Ruby/ . I hosted I Love Ruby book on Open Mail Box, but now since they have made their service paid, I have moved to github 100%.

Hope you find my book useful.

--
Karthikeyan A K

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJR%2B9kZ6XsL8CdAXT_OzHm6fo1XXZ%2BtCfCmE1HkkQdGVpD7rig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2859B752-0A0C-40AF-A6AA-816BA0ED429F%40gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Karthikeyan A K

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJR%2B9kZePnLcmH4%2B1UGAOLpJf6mgu8_9YpioBBQSRWvMEsp7nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Great read, thanks for publishing this! 


On Aug 8, 2017, at 10:31 AM, Karthikeyan A K <77minds@gmail.com> wrote:

Hello People,

Have fixed some broken links for https://mindaslab.github.io/I-Love-Ruby/ . I hosted I Love Ruby book on Open Mail Box, but now since they have made their service paid, I have moved to github 100%.

Hope you find my book useful.

--
Karthikeyan A K

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJR%2B9kZ6XsL8CdAXT_OzHm6fo1XXZ%2BtCfCmE1HkkQdGVpD7rig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello People,

Have fixed some broken links for https://mindaslab.github.io/I-Love-Ruby/ . I hosted I Love Ruby book on Open Mail Box, but now since they have made their service paid, I have moved to github 100%.

Hope you find my book useful.

--
Karthikeyan A K

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJR%2B9kZ6XsL8CdAXT_OzHm6fo1XXZ%2BtCfCmE1HkkQdGVpD7rig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello!

I wrote a 3-part series about computer science concepts in Ruby with code examples you can use right away.

Here's are the links for your convenience:


Let me know what you think :)

- Jesus Castello (Ruby Teacher & Mentor)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d6f9eeb5-fb3a-42c5-9da5-62c359e1acb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The order of inclusion in the routes file is important here. If you have:

devise_for :users

[followed by]

resources :users

...then the rake routes command will show you that the `user PATCH` path will be handled by the users_controller. If you have those two in the opposite order, then you will see that `users PATCH` (note the plural) will be handled by the devise_controller, and the path will be named users_registration.

What do you see when you rake routes in your application? You may also need to restrict your resources :users route to just a few actions with the `only: [:your, :actions, :here]` syntax. Also, what does your devise_for look like? I have found that the order of module inclusion can be important.

Walter


> On Aug 8, 2017, at 5:47 AM, fugee ohu <fugee279@gmail.com> wrote:
>
> How do I edit users when i have devise_for :users and resources :users I have a users controller with it's own whitelist and then I can whitelist for devise in application_controller.rb What's the status of the crud users controller and it's whitelist? I've been trying to edit a user but the changes don't take It says user was successfully updated but then when I click edit again nothing's changed
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8931cf8-d7f8-4523-aaa8-ee3fbf4d44b0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/DF079E0E-0E6E-44DF-AA97-292D1BC839AF%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

How do I edit users when i have devise_for :users and resources :users I have a users controller with it's own whitelist and then I can whitelist for devise in application_controller.rb What's the status of the crud users controller and it's whitelist? I've been trying to edit a user but the changes don't take It says user was successfully updated but then when I click edit again nothing's changed

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8931cf8-d7f8-4523-aaa8-ee3fbf4d44b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi there,


I am using gem 'react-rails' for rails. I have one questions why my import react doens't working on my assets ?

thx

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4577df74-31ac-43fa-83f7-ad2adfde3bce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Monday, August 7, 2017

model:
REPRESENTS_TYPES = ["Individual","Publicity firm","Record label"]
  validates :represents, inclusion: REPRESENTS_TYPES


form:
  <div class="field">
    <%= f.label :represents %><br>
    <%= f.select :represents, User::REPRESENTS_TYPES, prompt: ('Select') %>
  </div>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c9382a59-ea0e-4208-834f-d360d1dbb192%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am developing a rails-api application using mongodb as database. The problem is each time i try rails generators, 


It raises an exception in terminal :--

/user/.gem/ruby/gems/railties-5.1.3/lib/rails/application/configuration.rb:139:in database_configuration': Cannot loadRails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"] (RuntimeError)


Since, i am using mongodb it does not requires database.yml file.


Expected behavior

It should execute rails g scaffold article2 name:string content:text command without any error.


Actual behavior

Right now it is raising the exception

/user/.gem/ruby/gems/railties-5.1.3/lib/rails/application/configuration.rb:139:in database_configuration': Cannot loadRails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"] (RuntimeError)


System configuration

Rails version: 5.1.3

Ruby version: 2.4.1


And hence, i want to ask how to solve this problem!!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/47b4ad0b-7b95-47d5-aa99-97a1b666db3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Rails community,

I have been investigating and debugging a serious, widespread problems with our Rails 4.1 app (I realize Rails 4.1 is no longer supported, see below.)

This is not a simple "pass the CSFR token from the form to the controller" question. 

This appears to me to be a serious, widespread architectural flaw in Rails 4.0 and Rails 4.1 that appear to basically make those versions of Rails essentially incompatible with newer browsers. (The newer browsers, by the way, appear not to be respecting Cache-control headers, which looks to me the like the root of the problem)

The problem is detailed here:

https://stackoverflow.com/questions/45329731/csrf-tokens-to-not-match-what-is-in-session-rails-4-1?noredirect=1#comment77622671_45329731


Quick question: 

As explained here, I understand that the CSRF implementation to be different in Rails 5. Specifically, each form gets its own token. My question is this: Does this new design in Rails 5 eliminate or lessen the symptom described in my SO post above?

If so, this would be a compelling reason for us to upgrade to Rails 5, as we think we are loosing a significant amount of traffic due to this bug. 

If not, I am wondering if others are seeing this too and what can be done to address this issue. 

-Jason




If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com (more about setting GPG: https://gpgtools.org

Ruby on Rails

Hi everyone, I'm new at RoR and I'm having a trouble in my app. The problem consists on filter a select field named "Solution", based on the others select fields above it. The attached image shows an example of these fields.

Now, what the app do is to retrieve all information from BD abaout Area, Region, Associated, Solution and populate the select fields with these data. But the user wants that, when an area, a region and an associated is selected by the user, only the solutions about that associated in that region on that area should be shown. I know there is a way to do this with AJAX and JS, but I would like to do this with ruby only, in order to keep code clean and correct. Here is my controller code which populates the select fields:

def populate_selects
       @atendiment_area_users = AtendimentAreaUser.where(status: true, user_id: current_user.id)
       @atendiment_region_users = AtendimentRegionUser.where(status: true, user_id: current_user.id)
       @atendiment_region_associated = AtendimentRegionAssociated.where(status: true, entity_id: current_user.entity_id).where(atendiment_region_id: @atendiment_region_users.map(&:atendiment_region_id))
       @solution = Solution.where(entity_id: current_user.entity_id, status: true)
end

Below, the _form.html.erb code from view:

(...form_for...)
    <div class="field">
    <div class="row">
      <div class="col-xs-6">
        <%= f.select :atendiment_area_user_id , @atendiment_area_users.collect { |c| [ c.atendiment_area.name, c.id ] }, {:prompt=>"Area"}, { :class => 'form-control', :required => true } %>
      </div>
      <div class="col-xs-6">
        <%= f.select :atendiment_region_user_id , @atendiment_region_users.collect { |c| [ c.atendiment_region.name, c.id ] }, {:prompt=>"Region"}, { :class => 'form-control', :required => true } %>
      </div>
    </div>
  </div>

    <div class="field">
        <%= f.select :atendiment_region_associated_id , @atendiment_region_associated.collect { |c| [ c.associated.name, c.id ] }, {:prompt=>"Associated"}, { :class => 'form-control', :required => true } %>
      </div>
      <div class="field">
        <%= f.select :solution_id , @solution.collect { |c| [ c.solution.name, c.id ] }, {:prompt=>"Solution"}, { :class => 'form-control', :required => true } %>
      </div>

I've tried to use the AJAX remote: true on form_for, but it didn't worked.  If anyone can help, I apreciate. Thx for attention and sorry any bad english..

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/abdfa99a-14b6-4656-bb5b-e7a83a3cbe80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.