Ruby on Rails Sunday, July 31, 2016

On Sunday, July 31, 2016 at 4:50:23 PM UTC+1, Tomasz Antas wrote:
> I'm looking for the general concept, but every tip can be useful. The client (mobile) has to send a large file to Rails API. It's a some text file with raw data.
> How can the Rails API get the large file from client? Should it be done by HTTP request, websockets? Should the files be sent in chunks?

This obviously depends on your setup but I would probably have the client send the file straight to s3 and process it asynchronously

Fred

--
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/15424a64-479b-405a-a0b4-b34d2d037afe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think you could look at patterns of a progressive web application.
https://medium.com/@AdityaPunjani/building-flipkart-lite-a-progressive-web-app-2c211e641883#.4zqhjwuvx
flipkart mobile web application makes use of this. That's a life changing pattern for web apps but I'm afraid about compatibility issues with every browsers out there.

On Wednesday, July 27, 2016 at 5:34:57 PM UTC+5:30, amitoj singh wrote:
Hello Developers,
I am working on a Web rails project which is working fine with the
Internet. But I have to use this project in the areas where there is
no or very less internet connection. So I would have to make this web
application work offline.

The application contains multiple pages. How can I do so? I thought to
do so using cache I have found this
http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
in my application? If yes then how?. I want all my views(html) as well
as assets( stylesheet and Javascript) should work offline.

I had tried rack offline but it can only do single page offline. Now I
am working on service worker but still unable to do multiple pages
offline.
Thanks.


--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/3ce7a587-80ff-4599-81ab-b358b84fa83e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm looking for the general concept, but every tip can be useful. The client (mobile) has to send a large file to Rails API. It's a some text file with raw data.

How can the Rails API get the large file from client? Should it be done by HTTP request, websockets? Should the files be sent in chunks?

--
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/3a5a563f-c5d4-4511-a191-2332b709351d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


On Saturday, July 30, 2016 at 6:22:06 PM UTC+5:30, James Davis, PhD wrote:
Perhaps a mobile app would provide the solution you seek. I recently created an iOS app (using RubyMotion) that works offline and syncs with my webapp when it has connectivity again.
 
You means to create a new mobile 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/ecc449f2-3e42-4da7-ae0e-66ab0ac3ff49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Saturday, July 30, 2016

I am trying to upload videos to my Vimeo account from my RoR 5
application using the Vimeo api and the option "Resumable HTTP PUT
uploads":
https://developer.vimeo.com/api/upload/videos#resumable-http-put-uploads

For this I'am using paperclip to upload the video to my application and
after I want to do a multipart put request to send the file with the
"Content-Length:" "Content-Type:" headers as specify the API
documentation, but I don't have idea how to send the video file via put
request. Any help?.
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 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/87f1fcd39f1e39aef1d282548ae416ce%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Perhaps a mobile app would provide the solution you seek. I recently created an iOS app (using RubyMotion) that works offline and syncs with my webapp when it has connectivity again.

--
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/3441dca4-88c7-41a2-9796-459f3005ad81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Glad to hear you figured it out. It gets easier. Errors that used to take me hours to find / fix now take seconds.

--
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/b0f16fba-d539-4318-a89e-14cf18a2954f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Friday, July 29, 2016

I found the problem: I missed the step to make sure application.css was
renamed to application.scss

Sorry for the noise.

Thanks,

Craig

--
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 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/8427b76ae67d264fe402983b3dc4b4e5%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello all,

I am a complete and total newbie when it comes to Ruby on Rails so
please excuse the question:
I am trying to bring in the default Navbar from bootstrap.
I think I followed all the instructions on the bootstrap website, but
when I refresh my page all the text elements display, but none of the
graphics are displaying properly.
I have attached a screen shot to show what I mean.

Any idea where I have gone awry?

Thanks,

Craig

Attachments:
http://www.ruby-forum.com/attachment/11414/Screenshot_from_2016-07-29.jpeg


--
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 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/6fb287870e76fac852365c13c5a77818%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Fri, Jul 29, 2016 at 3:47 AM, amitoj singh <amitojsingh95@gmail.com> wrote:

> The main thing in our application which we want to store in the cache
> is a form. User can view and enter their information in the
> form(without internet connectivity) and that information is stored
> locally and when the application connects to the internet can
> automatically sync the data which is present locally with the main
> database on the server.

For that specific use case, you can write a browser-based JavaScript
application using local storage* but this really has little to do with Rails,
other than duplicating a lot of the logic of your app :-)

[*] https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
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/CACmC4yDf-Z-jCECU5d6GyDddf8DTr0EheC8%2BmrA68mVkJ%3DWP6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I doubt you can do that, you would need to have a local copy of the rails app running against a local database I would have thought, but that is probably not good for security

On Friday, 29 July 2016 11:48:34 UTC+1, amitoj singh wrote:
On Fri, Jul 29, 2016 at 2:28 PM, Mike <mike.s...@gmail.com> wrote:
> Reading the original post it sounds like the application is on the internet,
> but if the user is in a bad signal, or middle of the jungle area with no
> signal they still want the app to work.

Yup, The application is specially design for them who can not assess
the internet or the internet is not available there.

> There is no way that this will really happen as the dynamic pages will still
> require a connection to the server, you cannot cache a dynamic page (you can
> cache the result of a call for a limited time, but that is not dynamic),
> that is the point, it is dynamic, and so needs connectivity. you can cache
> the static assets, but that is about all.

The main thing in our application which we want to store in the cache
is a form. User can view and enter their information in the
form(without internet connectivity) and that information is stored
locally and when the application connects to  the internet can
automatically sync the data which is present locally with the main
database on the server.


--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/5a87afb8-932d-4105-bcc2-e1cb92f3221a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Fri, Jul 29, 2016 at 2:28 PM, Mike <mike.simkins@gmail.com> wrote:
> Reading the original post it sounds like the application is on the internet,
> but if the user is in a bad signal, or middle of the jungle area with no
> signal they still want the app to work.

Yup, The application is specially design for them who can not assess
the internet or the internet is not available there.

> There is no way that this will really happen as the dynamic pages will still
> require a connection to the server, you cannot cache a dynamic page (you can
> cache the result of a call for a limited time, but that is not dynamic),
> that is the point, it is dynamic, and so needs connectivity. you can cache
> the static assets, but that is about all.

The main thing in our application which we want to store in the cache
is a form. User can view and enter their information in the
form(without internet connectivity) and that information is stored
locally and when the application connects to the internet can
automatically sync the data which is present locally with the main
database on the server.


--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/CAKiq3e%3DKjq2ip4326xJwoZtPNE6wEvdkZo6N5Vy7jm-8Z%2BkZMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Reading the original post it sounds like the application is on the internet, but if the user is in a bad signal, or middle of the jungle area with no signal they still want the app to work. 

There is no way that this will really happen as the dynamic pages will still require a connection to the server, you cannot cache a dynamic page (you can cache the result of a call for a limited time, but that is not dynamic), that is the point, it is dynamic, and so needs connectivity. you can cache the static assets, but that is about all.



On Friday, 29 July 2016 05:02:45 UTC+1, tamouse wrote:
On Thu, Jul 28, 2016 at 8:04 AM, Rupinder Kaur <rupinde...@gmail.com> wrote:
On Wednesday, July 27, 2016 at 9:35:35 PM UTC+5:30, Colin Law wrote:
On 27 July 2016 at 12:55, amitoj singh <amitoj...@gmail.com> wrote:
> Hello Developers,
> I am working on a Web rails project which is working fine with the
> Internet. But I have to use this project in the areas where there is
> no or very less internet connection. So I would have to make this web
> application work offline.
>
> The application contains multiple pages. How can I do so? I thought to
> do so using cache I have found this
> http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
> in my application? If yes then how?. I want all my views(html) as well
> as assets( stylesheet and Javascript) should work offline.
>
> I had tried rack offline but it can only do single page offline. Now I
> am working on service worker but still unable to do multiple pages
> offline.

Rails caching as described in the guide describes how to cache common
pages on the server, not in the browser PC.  If you do not have access
to the internet (and therefore cannot access the server) then this
form of caching will not help.

If you want to use your application offline then the pages must be
saved somewhere.  Where are you hoping that this might happen?   In
the browser?

Colin

Hello developers,

I am also facing the same problem. I am trying to make the whole rails app offline which has multiple pages with dynamic content and photos as well as the audio file. I tried the rack-offline but found that it does not work for me because it is outdated and then try the serviceworker-rails gem and follow the  https://rossta.net/blog/offline-page-for-your-rails-application.html tutorial and create one page that works offline when the app is not connected to the internet but my requirement is to make the multiple pages of the application work offline which have dynamic content instead of creating a new page. Please suggest me some alternative. I am new in rails and I tried a lot of ways but did not get the solution yet because I don't have any prior experience. How should I store the pages that will work offline? How can we do so? 


It sounds to me as though you both (amitoj singh and Rupinder Kaur) actually want to run from a server that is not attached to the internet, but you can still point your browsers at. This retians the rails-ness of your application, but doesn't allow anyone on the internet to access it.

--
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/c821ce58-52f9-4671-b90d-17cad94fe253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Thursday, July 28, 2016

On Thu, Jul 28, 2016 at 8:04 AM, Rupinder Kaur <rupinderwadali@gmail.com> wrote:
On Wednesday, July 27, 2016 at 9:35:35 PM UTC+5:30, Colin Law wrote:
On 27 July 2016 at 12:55, amitoj singh <amitoj...@gmail.com> wrote:
> Hello Developers,
> I am working on a Web rails project which is working fine with the
> Internet. But I have to use this project in the areas where there is
> no or very less internet connection. So I would have to make this web
> application work offline.
>
> The application contains multiple pages. How can I do so? I thought to
> do so using cache I have found this
> http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
> in my application? If yes then how?. I want all my views(html) as well
> as assets( stylesheet and Javascript) should work offline.
>
> I had tried rack offline but it can only do single page offline. Now I
> am working on service worker but still unable to do multiple pages
> offline.

Rails caching as described in the guide describes how to cache common
pages on the server, not in the browser PC.  If you do not have access
to the internet (and therefore cannot access the server) then this
form of caching will not help.

If you want to use your application offline then the pages must be
saved somewhere.  Where are you hoping that this might happen?   In
the browser?

Colin

Hello developers,

I am also facing the same problem. I am trying to make the whole rails app offline which has multiple pages with dynamic content and photos as well as the audio file. I tried the rack-offline but found that it does not work for me because it is outdated and then try the serviceworker-rails gem and follow the  https://rossta.net/blog/offline-page-for-your-rails-application.html tutorial and create one page that works offline when the app is not connected to the internet but my requirement is to make the multiple pages of the application work offline which have dynamic content instead of creating a new page. Please suggest me some alternative. I am new in rails and I tried a lot of ways but did not get the solution yet because I don't have any prior experience. How should I store the pages that will work offline? How can we do so? 


It sounds to me as though you both (amitoj singh and Rupinder Kaur) actually want to run from a server that is not attached to the internet, but you can still point your browsers at. This retians the rails-ness of your application, but doesn't allow anyone on the internet to access it.

--
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/CAHUC_t9LY4eThWRjo0DcAC3gC9XGMX4%3DH0GnF3vXqXajVL-5jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 28 July 2016 at 15:47, Rupinder Kaur <rupinderwadali@gmail.com> wrote:
>
>> I do not know how you could do that other than by writing an
>> application that you install on the PC or on the local network.
>>
>> Colin
>
>
> Sorry, did not get you :(.

I mean that I cannot see how you can get the browser to do the things
you describe while it is not connected to the internet. The only way
I can see to do it is to have an application running on the PC or on
another machine on your local network that does those things.

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/a02b5e67-139c-4035-ba4b-0befeb844b71%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/CAL%3D0gLtxSu0jr6tN7eXNrqZGT3Fppn9TAXK5Wj8Mo9E964BQAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


I do not know how you could do that other than by writing an
application that you install on the PC or on the local network.

Colin

Sorry, did not get 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/a02b5e67-139c-4035-ba4b-0befeb844b71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 28 July 2016 at 15:23, Rupinder Kaur <rupinderwadali@gmail.com> wrote:
>> What do you mean by "dynamic content"?
>>
>> Colin
>
> Dynamic content means that the data is fetched from the database (
> PostgreSQL database). For an example, we have a web page like to show the
> list of the members. The list is shown from the database and we can add or
> remove the members even when we are offline and when we connect to the
> internet it sync the data.

I do not know how you could do that other than by writing an
application that you install on the PC or on the local network.

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%3D0gLu8X7bVVVkwTBCe4HzS570vUER-D_EmA8nv58UmeeJY1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

What do you mean by "dynamic content"?

Colin
Dynamic content means that the data is fetched from the database ( PostgreSQL database). For an example, we have a web page like to show the list of the members. The list is shown from the database and we can add or remove the members even when we are offline and when we connect to the internet it sync the data.

--
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/c084ffe7-480b-421e-a552-1296dae22f65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 28 July 2016 at 14:04, Rupinder Kaur <rupinderwadali@gmail.com> wrote:
>
>
> On Wednesday, July 27, 2016 at 9:35:35 PM UTC+5:30, Colin Law wrote:
>>
>> On 27 July 2016 at 12:55, amitoj singh <amitoj...@gmail.com> wrote:
>> > Hello Developers,
>> > I am working on a Web rails project which is working fine with the
>> > Internet. But I have to use this project in the areas where there is
>> > no or very less internet connection. So I would have to make this web
>> > application work offline.
>> >
>> > The application contains multiple pages. How can I do so? I thought to
>> > do so using cache I have found this
>> > http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
>> > in my application? If yes then how?. I want all my views(html) as well
>> > as assets( stylesheet and Javascript) should work offline.
>> >
>> > I had tried rack offline but it can only do single page offline. Now I
>> > am working on service worker but still unable to do multiple pages
>> > offline.
>>
>> Rails caching as described in the guide describes how to cache common
>> pages on the server, not in the browser PC. If you do not have access
>> to the internet (and therefore cannot access the server) then this
>> form of caching will not help.
>>
>> If you want to use your application offline then the pages must be
>> saved somewhere. Where are you hoping that this might happen? In
>> the browser?
>>
>> Colin
>
>
> Hello developers,
>
> I am also facing the same problem. I am trying to make the whole rails app
> offline which has multiple pages with dynamic content and photos as well as
> the audio file. I tried the rack-offline but found that it does not work for
> me because it is outdated and then try the serviceworker-rails gem and
> follow the
> https://rossta.net/blog/offline-page-for-your-rails-application.html
> tutorial and create one page that works offline when the app is not
> connected to the internet but my requirement is to make the multiple pages
> of the application work offline which have dynamic content instead of
> creating a new page. Please suggest me some alternative. I am new in rails
> and I tried a lot of ways but did not get the solution yet because I don't
> have any prior experience. How should I store the pages that will work
> offline? How can we do so?

What do you mean by "dynamic content"?

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%3D0gLvJ-3ULMCOqW%2Bt-ZOeofue%2Byk7FQ2qHn8FEi9FHRHAm2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Wednesday, July 27, 2016 at 9:35:35 PM UTC+5:30, Colin Law wrote:
On 27 July 2016 at 12:55, amitoj singh <amitoj...@gmail.com> wrote:
> Hello Developers,
> I am working on a Web rails project which is working fine with the
> Internet. But I have to use this project in the areas where there is
> no or very less internet connection. So I would have to make this web
> application work offline.
>
> The application contains multiple pages. How can I do so? I thought to
> do so using cache I have found this
> http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
> in my application? If yes then how?. I want all my views(html) as well
> as assets( stylesheet and Javascript) should work offline.
>
> I had tried rack offline but it can only do single page offline. Now I
> am working on service worker but still unable to do multiple pages
> offline.

Rails caching as described in the guide describes how to cache common
pages on the server, not in the browser PC.  If you do not have access
to the internet (and therefore cannot access the server) then this
form of caching will not help.

If you want to use your application offline then the pages must be
saved somewhere.  Where are you hoping that this might happen?   In
the browser?

Colin

Hello developers,

I am also facing the same problem. I am trying to make the whole rails app offline which has multiple pages with dynamic content and photos as well as the audio file. I tried the rack-offline but found that it does not work for me because it is outdated and then try the serviceworker-rails gem and follow the  https://rossta.net/blog/offline-page-for-your-rails-application.html tutorial and create one page that works offline when the app is not connected to the internet but my requirement is to make the multiple pages of the application work offline which have dynamic content instead of creating a new page. Please suggest me some alternative. I am new in rails and I tried a lot of ways but did not get the solution yet because I don't have any prior experience. How should I store the pages that will work offline? How can we do so? 
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/7adfbc67-bc22-4c1a-a671-5593ebc41ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello Developers,

I am Rupinderjit Kaur, contributing to Open Source Rails project. I am trying to make the whole application to work offline. For this to implement, I tried a lot of methods but did not get any solution yet. Actually, I am new in the world of Rails. 
Firstly, I tried rack-offline gem but found that I did not work because of outdated and then try the serviceworker-rails gem and use the service worker API of javascript and I follow this tutorial https://rossta.net/blog/offline-page-for-your-rails-application.html but by using this tutorial I create a new page that works offline when the app is not connected but my requirement is to make the whole app offline which has multiple pages that include the dynamic content as well as have the images and audio files. Can anyone please guide or suggest me something to make the whole app work offline. Is their any alternative to offline the multiple pages web app which has dynamic content. It's really urgent. Please help me as soon as possible.
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/59ca4fc6-5c4f-4e4a-b2ea-ea84a79293d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

> On Jul 28, 2016, at 4:37 AM, Johnny Stewart <lists@ruby-forum.com> wrote:
>
> I'd start looking around there, try disabling turbolinks and see if that
> makes a difference..

But don't leave it off -- use this as a test to see if that's the problem, and then edit your script to change the event it observes from 'ready' to 'page:change'. The latter is added to the page load sequence by Turbolinks, and it is a catch-all -- it fires on a full reload and a turbolinks page replace -- so you only have to listen to one event to get all types of page "load".

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/DBA62B62-9430-4EE7-9D90-10D7031D388F%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Ruth Stephenson wrote in post #1184744:
> I thought a hit counter would be simple enough as it's a pretty basic
> piece of code to insert to a html page, however when I add statcounter
> to my rails app, all the navigation links break. Can anyone advise me as
> to the best way to insert something like this to my app? It works but
> when I click on a nav link, it just displays the hit counter on a blank
> page unless I reload the page or , if I use the invisible hit counter,
> it displays an empty page for whatever nav link I click.
>
> application.html.erb
>
> <!--
> * Statcounter to monitor visitors, etc to my webapp
> * @reference https://statcounter.com
> -->
>
> <!-- Start of StatCounter Code for Default Guide -->
> <script type="text/javascript">
> var sc_project=11051099;
> var sc_invisible=0;
> var sc_security="0e87dbf6";
> var scJsHost = (("https:" == document.location.protocol) ?
> "https://secure." : "http://www.");
> document.write("<sc"+"ript type='text/javascript' src='" +
> scJsHost+
> "statcounter.com/counter/counter.js'></"+"script>");
> </script>
> <noscript><div class="statcounter"><a title="shopify
> analytics" href="http://statcounter.com/shopify/"
> target="_blank"><img class="statcounter"
> src="//c.statcounter.com/11051099/0/0e87dbf6/0/"
> alt="shopify analytics"></a></div></noscript>
> <!-- End of StatCounter Code for Default Guide -->

If it works when you explicitly reload the page it sounds like your new
javascript might not be playing well with turbolinks.

I'd start looking around there, try disabling turbolinks and see if that
makes a difference..

J

--
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 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/2d35e8c7ef4826f62024cf9ee2f04c97%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, July 27, 2016



On Wed, Jul 27, 2016 at 4:05 PM, tom <tomabroad@gmail.com> wrote:
cd /rorapps/foo/staging/foo_com/releases/20160727210019 && /usr/bin/env sidekiq --index 0 --pidfile /rorapps/foo/stagingfoo_com/shared/tmp/pids/sidekiq-0.pid --environment staging --logfile /rorapps/foo/staging/foo_com/shared/log/sidekiq.log --daemon
 DEBUG [b52ffd5f]       /usr/bin/env:
 DEBUG [b52ffd5f]       sidekiq
 DEBUG [b52ffd5f]       : No such file or directory


but when i ssh into the server (same user as cap(set :user)) and copy & paste the command it goes through without error...
what is wrong here?

I don't know specifically, but usually this is because your environment logging in through ssh is different than the one an ssh command runs in.  

--
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/CAHUC_t_ZUDKoXg8w10x9n4ge9HzCUSxLp%2BMzKvN_GfG8yqC-eA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm curious to know how prevalent the use of Turbolinks/PJAX is amongst
professional Rails developers relative to Angular/React/Ember + Rails
API? After watching some recent presentations on Rails 5 with improved
Turbolinks/PJAX I came away with the impression that Rails 5 presents
the strongest case in its history for server-side, document-based apps
countering the undiscriminating adoption of SPA approaches.

If you're a professional Rails developer what's the split between
PJAX/SPA in the projects you've completed?

gvim

--
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/57995074.9050608%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

cd /rorapps/foo/staging/foo_com/releases/20160727210019 && /usr/bin/env sidekiq --index 0 --pidfile /rorapps/foo/stagingfoo_com/shared/tmp/pids/sidekiq-0.pid --environment staging --logfile /rorapps/foo/staging/foo_com/shared/log/sidekiq.log --daemon
 DEBUG [b52ffd5f]       /usr/bin/env:
 DEBUG [b52ffd5f]       sidekiq
 DEBUG [b52ffd5f]       : No such file or directory


but when i ssh into the server (same user as cap(set :user)) and copy & paste the command it goes through without error...
what is wrong here?

--
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/CADQqhMfpnCc5sBtfTHe3%2BS65ZMqxxZBM3Kw0yHrYr%3DKHyP8ETg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Wed, Jul 27, 2016 at 9:34 PM, Colin Law <clanlaw@gmail.com> wrote:
>
> Rails caching as described in the guide describes how to cache common
> pages on the server, not in the browser PC. If you do not have access
> to the internet (and therefore cannot access the server) then this
> form of caching will not help.
>
> If you want to use your application offline then the pages must be
> saved somewhere. Where are you hoping that this might happen? In
> the browser?
>
> Colin

Yup. Actually, I thought to do this by using browser cache. Is this
the right way to do so? Is there any other way to do this?


--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/CAKiq3enVTpV4F-XRSZKOrtfJdP3t4_0gX5%2ByB5droQcw67EgAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 27 July 2016 at 12:55, amitoj singh <amitojsingh95@gmail.com> wrote:
> Hello Developers,
> I am working on a Web rails project which is working fine with the
> Internet. But I have to use this project in the areas where there is
> no or very less internet connection. So I would have to make this web
> application work offline.
>
> The application contains multiple pages. How can I do so? I thought to
> do so using cache I have found this
> http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
> in my application? If yes then how?. I want all my views(html) as well
> as assets( stylesheet and Javascript) should work offline.
>
> I had tried rack offline but it can only do single page offline. Now I
> am working on service worker but still unable to do multiple pages
> offline.

Rails caching as described in the guide describes how to cache common
pages on the server, not in the browser PC. If you do not have access
to the internet (and therefore cannot access the server) then this
form of caching will not help.

If you want to use your application offline then the pages must be
saved somewhere. Where are you hoping that this might happen? In
the browser?

Colin

> Thanks.
>
>
> --
> "Never repeat yourself"
> Amitoj singh
> slideshare.com/amitoj95
> github.com/amitojsingh
> amitojsworld.wordpress.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/CAKiq3e%3DkGm_GVcZRxDwMVANWX5XdU-mAOVD%3DSP%3DnAzYo4d01zw%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/CAL%3D0gLsMZbSJBjtO6S3dKdww3Wy6%2BkVCDpbPvqEfDdCGjLAeuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Wed, Jul 27, 2016 at 5:25 PM, amitoj singh <amitojsingh95@gmail.com> wrote:
> http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
> in my application? If yes then how?. I want all my views(html) as well
> as assets( stylesheet and Javascript) should work offline.


I had use this It works for a few minutes but after that it won't why so?

--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/CAKiq3en-TzLOqgiOe1riU25jJT3-%2ByPzjm5eYbNou%2B%3DGT_0EGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The password is in the session cookie:

if user && user.authenticate(params[:session][:password])


On Tuesday, July 26, 2016 at 5:19:36 AM UTC-7, Ruby-Forum.com User wrote:
In my SessionController, I tried to authenticate the user but it's
failing to authenticate even though I output the information and it's
all correct.I'm following this tutorial:
https://youtu.be/Hw6WtWJwRtU?list=PLS-X3A6Dr2qPXTSxMf6XPiO9HCkJLe51z

Below is my code:

def create
    user = User.find_by(email: params[:email].downcase)
    if user && user.authenticate(params[:password])
 

--
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/5052b8ef-7b1f-450e-909d-a354ffcd4ecf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello Developers,
I am working on a Web rails project which is working fine with the
Internet. But I have to use this project in the areas where there is
no or very less internet connection. So I would have to make this web
application work offline.

The application contains multiple pages. How can I do so? I thought to
do so using cache I have found this
http://guides.rubyonrails.org/caching_with_rails.html. Can I use this
in my application? If yes then how?. I want all my views(html) as well
as assets( stylesheet and Javascript) should work offline.

I had tried rack offline but it can only do single page offline. Now I
am working on service worker but still unable to do multiple pages
offline.
Thanks.


--
"Never repeat yourself"
Amitoj singh
slideshare.com/amitoj95
github.com/amitojsingh
amitojsworld.wordpress.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/CAKiq3e%3DkGm_GVcZRxDwMVANWX5XdU-mAOVD%3DSP%3DnAzYo4d01zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, July 26, 2016

In my SessionController, I tried to authenticate the user but it's
failing to authenticate even though I output the information and it's
all correct.I'm following this tutorial:
https://youtu.be/Hw6WtWJwRtU?list=PLS-X3A6Dr2qPXTSxMf6XPiO9HCkJLe51z

Below is my code:

def create
user = User.find_by(email: params[:email].downcase)
if user && user.authenticate(params[:password])
session[:user_id] = user.id
flash[:notice] = "Welcome back, #{user.name}!"
redirect_to user
else
flash.now[:alert] = "Invalid email/password combination!
#{user.name}, #{user.id}, #{params[:password]}"
render :new
end
end
def destroy
session[:user_id] = nil
redirect_to :new
end

The authenticate works fine in rails console but not when the rails
server. The problem is with this line
user.authenticate(params[:password]) of code.

Any help is much appreciated.

--
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 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/13583a22448c3a38bc18dc44cf1a9e7a%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Monday, July 25, 2016

On Monday, July 25, 2016 at 7:52:52 PM UTC+1, Ruby-Forum.com User wrote:
> I thought a hit counter would be simple enough as it's a pretty basic
> piece of code to insert to a html page, however when I add statcounter
> to my rails app, all the navigation links break. Can anyone advise me as
> to the best way to insert something like this to my app? It works but
> when I click on a nav link, it just displays the hit counter on a blank
> page unless I reload the page or , if I use the invisible hit counter,
> it displays an empty page for whatever nav link I click.

Perhaps some sort of interaction with turbolinks?

Fred


>
> application.html.erb
>
> <!--
> * Statcounter to monitor visitors, etc to my webapp
> * @reference https://statcounter.com
> -->
>
> <!-- Start of StatCounter Code for Default Guide -->
> <script type="text/javascript">
> var sc_project=11051099;
> var sc_invisible=0;
> var sc_security="0e87dbf6";
> var scJsHost = (("https:" == document.location.protocol) ?
> "https://secure." : "http://www.");
> document.write("<sc"+"ript type='text/javascript' src='" +
> scJsHost+
> "statcounter.com/counter/counter.js'></"+"script>");
> </script>
> <noscript><div class="statcounter"><a title="shopify
> analytics" href="http://statcounter.com/shopify/"
> target="_blank"><img class="statcounter"
> src="//c.statcounter.com/11051099/0/0e87dbf6/0/"
> alt="shopify analytics"></a></div></noscript>
> <!-- End of StatCounter Code for Default Guide -->
>
> --
> 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 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/5f118bc6-dd70-457a-babe-b8ae01e8d99d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I thought a hit counter would be simple enough as it's a pretty basic
piece of code to insert to a html page, however when I add statcounter
to my rails app, all the navigation links break. Can anyone advise me as
to the best way to insert something like this to my app? It works but
when I click on a nav link, it just displays the hit counter on a blank
page unless I reload the page or , if I use the invisible hit counter,
it displays an empty page for whatever nav link I click.

application.html.erb

<!--
* Statcounter to monitor visitors, etc to my webapp
* @reference https://statcounter.com
-->

<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=11051099;
var sc_invisible=0;
var sc_security="0e87dbf6";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify
analytics" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="//c.statcounter.com/11051099/0/0e87dbf6/0/"
alt="shopify analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->

--
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 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/d89cf1c509bd7546321c91d83e798363%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi everyone. I faced with such problem:
My model Order accepts nested attributes for model Address. It belongs
to Address model and has shipping and billing address. I use nested
forms to update or create addresses and everything is fine but I need to
make an ability to mark checkobox 'use billing address for shipping' to
avoid user to fill shipping address form and just use the same data as
billing. So i can't understand how to do that. I receive attributes with
their proper ids from DB and I can't just tell 'If checkbox so
shipping_attributes = biling_attributes'. Here's my controller

def update
return redirect_to address_path if @order.update(order_params)
render :show
end

private


def init_order
@order = current_order
end

def order_params
params.require(:order).permit(shipping_address_attributes:
address_params,
billing_address_attributes:
address_params)
end

def address_params
%i(id first_name last_name street zip_code city phone country)
end

So I should write some condition in update action to perform this. But
how to do it most clearly???

--
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 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/6ddcdf201a1ea30512b8cb3f80da9388%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Using authentication and authorization, lock down your ActionCable
WebSockets so that messages are only sent and received to the intended
users.
https://www.driftingruby.com/episodes/actioncable-part-3-securing-your-websockets

--
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 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/f3925e31a008a93d1efe29e8f300ccd2%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 25 July 2016 at 10:00, Deepak Sharma <deeky.sharma@gmail.com> wrote:
> On Mon, Jul 25, 2016 at 1:59 PM, Colin Law <clanlaw@gmail.com> wrote:
>> You have not made it clear exactly what the problem is. Which line in
>> the above is not doing what you expect?
>
> Problem is In below mentioned each statement part
>
> <% @student.comments.each do |comment| %>
> <li class="collection-item">
> <div>
>
> <%= comment.content %>
>
> </div>
> </li>
> <% end %>
>
>
> It's returning empty value, I checked it in database but nothing there.

Well if there is nothing in the database then why would you expect it
to show something in the view?

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%3D0gLtkje%3DriZ2va4C877VAf8V2cjdTL%3Det_YgmZLMSK3G4JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Mon, Jul 25, 2016 at 1:59 PM, Colin Law <clanlaw@gmail.com> wrote:
> You have not made it clear exactly what the problem is. Which line in
> the above is not doing what you expect?

Problem is In below mentioned each statement part

<% @student.comments.each do |comment| %>
<li class="collection-item">
<div>

<%= comment.content %>

</div>
</li>
<% end %>


It's returning empty value, I checked it in database but nothing there.

--
Cheers!

Deepak Kumar Sharma
Guru Nanak Dev Engineering College
India!

Blog: http://deekysharma.wordpress.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/CALDHwN6G_ODRZQyWdR--D6%3DdKcsfVwPuxaUDGAgfZa3YFo18mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 25 July 2016 at 09:24, Deepak Sharma <deeky.sharma@gmail.com> wrote:
> In my application I'm rendering comment part with each statement but
> getting an unusual response in it. An empty comment is always been
> there. I'm using Rails 4 with materialize css. This is how looks [1]
> like.
>
> Here is my code
>
> <div class="s12 m7 l8 col">
> <ul class="collection with-header">
>
> <li class="collection-header">
> <h5>Comment's for you</h5>
> </li>
>
> <% @student.comments.each do |comment| %>
> <li class="collection-item">
> <!-- Content in single row -->
> <div>
>
> <%= comment.content %>
>
> <% if comment.user_id == current_user.id ||
> current_user.try(:admin?) %>
> <%= link_to [comment.student, comment], method: :delete, class:
> "secondary-content" do %>
> <i class="material-icons">delete</i>
> <% end %>
> <% end %>
> </div>
> </li>
> <% end %>
> </ul>
> </div>
>
>
> [1] : http://www.awesomescreenshot.com/image/1422159/fbabde9acca44d7813726991a087eb40

You have not made it clear exactly what the problem is. Which line in
the above is not doing what you expect?

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%3D0gLtxqXCrGHQwe59%2BXKufU2BhQ6XOPt1VE9DMPGWoDuRzEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

In my application I'm rendering comment part with each statement but
getting an unusual response in it. An empty comment is always been
there. I'm using Rails 4 with materialize css. This is how looks [1]
like.

Here is my code

<div class="s12 m7 l8 col">
<ul class="collection with-header">

<li class="collection-header">
<h5>Comment's for you</h5>
</li>

<% @student.comments.each do |comment| %>
<li class="collection-item">
<!-- Content in single row -->
<div>

<%= comment.content %>

<% if comment.user_id == current_user.id ||
current_user.try(:admin?) %>
<%= link_to [comment.student, comment], method: :delete, class:
"secondary-content" do %>
<i class="material-icons">delete</i>
<% end %>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>


[1] : http://www.awesomescreenshot.com/image/1422159/fbabde9acca44d7813726991a087eb40


--
Cheers!

Deepak Kumar Sharma
Guru Nanak Dev Engineering College
India!

Blog: http://deekysharma.wordpress.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/CALDHwN5m4LndYwd2%3D8Zhn2GmAc0TnCZ%2BwS9s8OLMgzditVP8sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Sunday, July 24, 2016

<%= form_tag('URL', :multipart => true) do %>
<p>
Video: <%= file_field_tag :avatar %>
</p>
<p>
<%= submit_tag %>
</p>
<% end %>

Is there any way to know the content_type and content_size of file
before submit the form and send them as params to the POST request?

--
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 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/f70c433c4c1435ad7a8ced62200ef4df%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.