Ruby on Rails Tuesday, May 31, 2016

A guide to configure your Ubuntu installation and deploy a Ruby on Rails
application. Lock down the settings to prevent unwanted access.

https://www.driftingruby.com/episodes/production-deployment-on-ubuntu

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

Ruby on Rails Monday, May 30, 2016

Running into the same problem as you (trying to use ActionCable in React
Native)
So far I can't find any solution so I am going to write one myself too.
How is your attempt at it?

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

Ruby on Rails

On 30 May 2016 at 12:40, Palak Mehta <palak.m@bewakoof.com> wrote:
> Hi ,
> This has been a daunting task . One i type 'rails s' on my console i get no
> error .. but doesn't reflect on localhost:3000 on any of my browsers.
> Also the problem is only with my existing project , if i create a new
> project it works ..

Copy/paste the complete output from the terminal when you run rails s.

What do you see in the browser when you try to access localhost:3000 in Firefox.

Is there any output in the server terminal window when you try to
access localhost:3000?

Please answer all questions.

Colin

> i have tried everything from checking my hosts file to trying telnet .. but
> other than my existing project .. everything looks fine .
> Also no error in logs or console .. everything starts normally ..
> it can't be a localhost problem because other project works , just one
> specific doesn't ..
> I bought a new mac pro .. earlier was working on linux and it works fine on
> it ..
> Please Help.
> Palak Mehta.
>
> --
> 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/033bef5a-84d3-4a1f-abf1-a5846d2b6d9f%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%3D0gLsOKVAjWr-%2B0aYw3Ocz91g8sLwwx9wf6PTcMUqouXKH9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi , 
 This has been a daunting task . One i type 'rails s' on my console i get no error .. but doesn't reflect on localhost:3000 on any of my browsers.
Also the problem is only with my existing project , if i  create a new project it works .. 
i have tried everything from checking my hosts file to trying telnet .. but other than my existing project .. everything looks fine .
Also no error in logs or console .. everything starts normally ..
it can't be a localhost problem because other project works , just one specific doesn't .. 
I bought a new mac pro .. earlier was working on linux and it works fine on it .. 
Please Help.
Palak Mehta.

--
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/033bef5a-84d3-4a1f-abf1-a5846d2b6d9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Sunday, May 29, 2016

put a table / model  like orginiation_user_roles / OrganizationUserRole with columns like organization_id, user_id , and roll . Make the roll as enum type http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html . I hope my answer helps.


On Sun, May 29, 2016 at 9:16 PM, John Sanderbeck <lists@ruby-forum.com> wrote:
What I am trying to do is setup a set of joins that do the following

User has a global role such as :global_admin, :building_admin, etc

I also have Organizations, Districts, and Buildings

I would like a user to be able to be assigned a different role per
Organization, District, or Building

I have a User with a global_role and that works fine.

I can't figure out how to define the user to be part of say an
Organization with different role.

Can anyone can show me an example or point me in the right direction to
figure this out?

John

--
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/703029e437465274d6a23b07331b933f%40ruby-forum.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/CAJR%2B9kbHpFEfMsjBZK4DBPzchxtS-1cf2%2B_N_-%2Bc_O_fnv9zyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

What I am trying to do is setup a set of joins that do the following

User has a global role such as :global_admin, :building_admin, etc

I also have Organizations, Districts, and Buildings

I would like a user to be able to be assigned a different role per
Organization, District, or Building

I have a User with a global_role and that works fine.

I can't figure out how to define the user to be part of say an
Organization with different role.

Can anyone can show me an example or point me in the right direction to
figure this out?

John

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

Ruby on Rails

Hi,

On Sun, May 29, 2016, at 09:36, Graham Menhennitt wrote:
> I'm trying to install rails 5. I've tried both beta4 and rc1, but both
> fail
> with the same problem - installing the turbolinks gem. There seem to be a
> number of versions of the gem on RubyGems beta1 - beta4. There also seems
> to be beta5 (but it's not listed there). But I can't install any of them.
> It seems to be trying to build from the beta2 version of the -source gem,
> but that version doesn't exist.
>

I don't know other proper way but adding turbolinks-source in the
Gemfile works.


$ cat Gemfile
source "https://rubygems.org"

gem "turbolinks", "~> 5.0.0.beta2"
gem "turbolinks-source", "~> 5.0.0.beta2"

$ bundle --path vendor/bundle
Fetching gem metadata from https://rubygems.org/.................
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing turbolinks-source 5.0.0.beta5
Using bundler 1.11.2
Installing turbolinks 5.0.0.beta2
Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
Bundled gems are installed into ./vendor/bundle.

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

Ruby on Rails Saturday, May 28, 2016

Hi Railsers,

I'm trying to install rails 5. I've tried both beta4 and rc1, but both fail with the same problem - installing the turbolinks gem. There seem to be a number of versions of the gem on RubyGems beta1 - beta4. There also seems to be beta5 (but it's not listed there). But I can't install any of them. It seems to be trying to build from the beta2 version of the -source gem, but that version doesn't exist.

I've tried:
# gem install turbolinks -v '5.0.0.beta2' --no-rdoc --no-ri
ERROR:  Could not find a valid gem 'turbolinks-source' (>= 0) in any repository
ERROR:  Possible alternatives: turbolinks, turbolinks-redirect, turbolinks-js, subtitle_source, rubygems-source

# gem install turbolinks -v '5.0.0.beta5' --no-rdoc --no-ri
ERROR:  Could not find a valid gem 'turbolinks' (= 5.0.0.beta5) in any repository
ERROR:  Possible alternatives: turbolinks

# gem install turbolinks  --no-rdoc --no-ri
ERROR:  While executing gem ... (Gem::DependencyError)
    Unresolved dependency found during sorting - rack (>= 1.0) (requested by rack-test-0.6.3)

# bundle install
An error occurred while installing turbolinks (5.0.0.beta2), and Bundler cannot continue.
Make sure that `gem install turbolinks -v '5.0.0.beta2'` succeeds before bundling.

I can install turbolinks-source (5.0.0.beta2) but that doesn't seem to help.

I successfully did this a few weeks ago, but now it's not working.

Thanks,
  Graham

--
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/9cd38c3d-d2ff-4625-8c10-f575c3e91732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think I found a solution: act_as_list.
Sometimes we just need persistant storage.

Thanks.

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

Ruby on Rails

On 27 May 2016 at 14:53, Zdravko Balorda <lists@ruby-forum.com> wrote:
> Yes. So how one can handle arrays properly?

Can you give us more information on what is in your array and for what
reason they are sorted? Someone may be able to suggest a better
solution to the problem.

Please quote the relevant parts of previous message when posting, this
is a mailing list not a forum (though you may be accessing it via a
forum-like interface) so it is not always obvious which message you
are replying to. Thanks.

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

Ruby on Rails Friday, May 27, 2016

You have to add an index column and use order by. SQL as a standard does not guarantee any ordering unless you enforce it, so any implementation can return elements in the order that is most efficient.


Zdravko Balorda <lists@ruby-forum.com> schrieb am Fr., 27. Mai 2016 15:53:
Yes. So how one can handle arrays properly?

--
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/2858647b1bc4ca6961e72af3ffcc10dd%40ruby-forum.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%2BbCVstanJDsWB3Ad-Bmt451XFPfKi0k-w0HnOzK_ydfUw%3DunA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Yes. So how one can handle arrays properly?

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

Ruby on Rails

Has many does not resemble an array but a set.


Zdravko Balorda <lists@ruby-forum.com> schrieb am Fr., 27. Mai 2016 15:20:
The way to implement arrays in ActiveRecord is via has_many.
But, normally Ruby arrays keep the order of elements, while has_many do
not.
This is not just a matter of "order by" clause.
At every update one needs to index database table rows properly, so that
"order by" would work.

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

Ruby on Rails

The way to implement arrays in ActiveRecord is via has_many.
But, normally Ruby arrays keep the order of elements, while has_many do
not.
This is not just a matter of "order by" clause.
At every update one needs to index database table rows properly, so that
"order by" would work.

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

Ruby on Rails

Norbert,

Thanks again!
I walked through the tutorial, rereading chapter 3, and there I found my mistake, in this line: Minitest::Reporters.use!

After correction, the test ran without errors!

--
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/3d8e83d1-be45-457c-9e78-00e8a92e40a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



Op vrijdag 27 mei 2016 10:03:51 UTC+2 schreef Norbert Melzer:
If you are able to, do an upgrade. If you can't just ignore the warning… In any case, it is not related to the remaining message you screenshotted instead of copy pasting… Just read along after the warning lines and take a closer look at the actual error, it gives you very good hints on how to proceed.

Norbert,

Thank you; you are right that copy / pasting is better. I will paste the text here underneath.
What I see is "rake aborted!". I guess that is the real error.
But what to do? Shall I do 'rake db:migrate'? But in this chapter of the tutorial there is no database implemented; not yet! I don't understand it?
The funny thing is: the 'sample_app' application is running without problems, as far as I can see!

Here the pasted screen lines:
==========================================================================================
kwibus:~/workspace $ cd sample_app
kwibus:~/workspace/sample_app (filling-in-layout) $ bundle exec rake test
RubyDep: WARNING: Your Ruby is outdated/buggy. (To disable warnings, set RUBY_DEP_GEM_SILENCE_WARNINGS=1)
RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.
RubyDep: WARNING: Your Ruby is outdated/buggy. (To disable warnings, set RUBY_DEP_GEM_SILENCE_WARNINGS=1)
RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.
/home/ubuntu/workspace/sample_app/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /home/ubuntu/workspace/sample_app/config/application.rb to limit the frameworks that will be loaded.
rake aborted!
NoMethodError: undefined method `use' for Minitest::Reporter:Class
/home/ubuntu/workspace/sample_app/test/test_helper.rb:5:in `<top (required)>'
/home/ubuntu/workspace/sample_app/test/controllers/static_pages_controller_test.rb:1:in `require'
/home/ubuntu/workspace/sample_app/test/controllers/static_pages_controller_test.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `require'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:113:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:20:in `invoke_rake_task'
/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.2/lib/rails/test_unit/testing.rake:8:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/cli/exec.rb:24:in `run'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/cli.rb:304:in `exec'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/cli.rb:11:in `start'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/exe/bundle:27:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.12.2/exe/bundle:19:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/bin/bundle:23:in `load'
/usr/local/rvm/gems/ruby-2.3.0/bin/bundle:23:in `<main>'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test:run
(See full trace by running task with --trace)

--
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/78a7ee76-18ee-419c-be47-ea85db8cb8c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

> On May 25, 2016, at 7:59 AM, Aditya Tyagi <lists@ruby-forum.com> wrote:
>
> @praveen_k95
>
> thank you for replying.
> i know, the update action is blank. but i am trying to edit this post
> already made. therefore i am working through edit only.
> actually i am trying to follow this tutorial and he is using 1.9.3
> version of ROR, and i am working on 4, and thats creating alot of
> issues.


Wow. Really find a newer tutorial. You are going to have such a translation problem between then and now that you are only going to hurt yourself. The only reason to mess with that version of Rails is if someone dumps a lot of money on you to upgrade it (rewrite it, at that distance) to current. The http://railstutorial.org is free to use on line and one of the best-written tutorials on any subject I have ever seen. It covers Rails 4.2, which is the current (soon to be less so with 5 coming out). I can't find a reference to Rails 1.9.3 (maybe you mean Ruby?), but if that's really the version, that's from 2007 or so. A lot has changed.

Walter

>
> --
> 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/5140ad78f34c8cc1deef00c0cb65bd0d%40ruby-forum.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/52BFFAA2-F635-4B4A-B631-93C6AF1A6DEE%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

> On May 25, 2016, at 6:28 AM, Saurav Kothari <sauravkothari2@gmail.com> wrote:
>
> I wrote a fairly lengthy post a few minutes ago in the hope of getting some help. But after it was posted I cannot see it in the list of topics in the group. Search results show nothing. Where did it disappear?
>
> Subject line was 'Check if input string conforms with DB collation' and was a question I have already asked on SO with no satisfactory answer.
>
> Regards,
> Saurav Kothari

It's there. Remember, this is a mailing list, not a forum, even if you approach it through a forum-like interface on the Web. E-mail is weird. Full stop. Mailing lists are even more weird. You may think it is synchronous, but it is not, and any cases that appear synchronous (even if they are the majority) are coincidence.

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/85001f24-54b6-46c1-87a6-228eba188a3e%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/5BF7F85B-1A0E-43DE-8314-5DDEA55E0C48%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I second this.  Sidekiq (especially version 4) is amazing.  Clockwork is great too for scheduling recurring jobs.  There was a sidetiq which would schedule sidekiq jobs however it is not actively being developed and lacks sidekiq 3.5.1 and 4.0 support.  You have to use a version that's back ported with Celluloid 0.17.1 (I think that's the version number).  I'd stay away from sidetiq and focus on clockwork and sidekiq itself.


If sidekiq becomes too much technical debt and you need something that just works and is easy to use minus the reds dependency and monitoring with bluepill or god, I recommend sucker_punch https://github.com/brandonhilkert/sucker_punch.  It does not have job re-enqueing or persistence past the memory space (if you restart your app server (puma/passenger/unicorn) you lose your pending jobs.  But it's a great little gem and I use it for lots of small projects where sidekiq is overkill.

Cheers,
James

Subscribe to my Youtube Channel: https://www.youtube.com/shakycode




On May 27, 2016, at 3:50 AM, Saurav <prionko@gmail.com> wrote:

Checkout both https://github.com/tomykaira/clockwork and https://github.com/mperham/sidekiq 

I have used both of them for scheduling different kind of background jobs.

Saurav


On Thursday, 26 May 2016 20:07:26 UTC+5:30, der_tom wrote:
which toll should i use? my task needs to be run after 1 hour or other time unit afte r the record has been created.


thx

tom


--
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/87c2cce7-082b-44c4-83aa-26389820fec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Checkout both https://github.com/tomykaira/clockwork and https://github.com/mperham/sidekiq 

I have used both of them for scheduling different kind of background jobs.

Saurav


On Thursday, 26 May 2016 20:07:26 UTC+5:30, der_tom wrote:
which toll should i use? my task needs to be run after 1 hour or other time unit afte r the record has been created.


thx

tom

--
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/87c2cce7-082b-44c4-83aa-26389820fec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

If you are able to, do an upgrade. If you can't just ignore the warning… In any case, it is not related to the remaining message you screenshotted instead of copy pasting… Just read along after the warning lines and take a closer look at the actual error, it gives you very good hints on how to proceed.

Ad Rienks <ad.rienks@gmail.com> schrieb am Fr., 27. Mai 2016 um 09:59 Uhr:

Hello,

I am doing this tutorial, currently in Chapter 5. I am testing listing 5.26 but get the feeling that not all is set up like it should.
The message: RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.
a bit alarming.
Can someone help with tips our suggestions?

Thank you,
Ad

--
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/93f7e02e-62a3-4b33-9f1b-4c30436a7b7b%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/CA%2BbCVsuQJvW58HGWHwXCZ90c-04rSHxcnWZUR8V%3D3wY7ywYumA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Thursday, May 26, 2016

Hello,

I am doing this tutorial, currently in Chapter 5. I am testing listing 5.26 but get the feeling that not all is set up like it should.
The message: RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.
a bit alarming.
Can someone help with tips our suggestions?

Thank you,
Ad

--
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/93f7e02e-62a3-4b33-9f1b-4c30436a7b7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am an experienced full-stack web developer. My best project can be
seen live [here](http://www.awesomeweb.com) - here is the
[story](http://www.incomediary.com/awesomeweb-story) back then.

I solo developed complete websites in the past.

You can find more about me on my blog at the
[about](http://www.stefanosioannou.com/about) section. Make sure to
check my
[bio](http://www.stefanosioannou.com/wp-content/uploads/2016/05/StefanosIoannouCV-May2016.pdf)
and
[skill-set](http://www.stefanosioannou.com/wp-content/uploads/2014/11/SkillsetTraining-StefanosIoannou.pdf)
spreadsheet.

My normal hourly rate is $30/hour and I can drop it as much as $25/hour
depending on the project's nature. My rate is low as where I live the
wage is lower than US, Canada and UK. This doesn't mean professionalism
and quality are compromised.

Feel free to contact Nicholas Tart, my colleague at AwesomeWeb that will
surely have lots to say about me. He is very friendly and approachable.

Feel free to contact me through the contact page of my blog, on my email
or phone (can be found in my CV) or at Skype (ID is stefioan).

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

Ruby on Rails

Most popular gem: https://github.com/mperham/sidekiq 



-----
Przemek Kosakowski

On maj 26 2016, at 4:37 pm, tom <tomabroad@gmail.com> wrote:
which toll should i use? my task needs to be run after 1 hour or other time unit afte r the record has been created.


thx

tom

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

Ruby on Rails

which toll should i use? my task needs to be run after 1 hour or other time unit afte r the record has been created.


thx

tom

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

Ruby on Rails

Hi guys,

I have a select tag in which I need to display schedule values.
Basically I need to do something like this:
<%= form.association :schedule, collection: @schedules %>

The problem I'm having is that the select value needs to be customized.
I need it to display the value "schedule.court.name - schedule.date
schedule.start_time-schedule.end_time"

How can I customize the value of the select tag?

Regards

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

Ruby on Rails

Hi honey jadala,

Actually I need implement the same using Java. If i get idea how to
collect punch-in from device, then rest i can build.

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

Ruby on Rails

You mentioned in this forum that you have small app which will collect
the punch-in from device and will push to the server.

Could please let me know how to collect the punch-in to build that small
app?

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

Ruby on Rails

A requests goes through nginx -> unicorn -> rails. You can check log files starting on the left side. You should be able to see where requests are dropped or misrouted.

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

Ruby on Rails

Hi,

I have a server with 20Cores / 40Threads.
I used to have only one website app (rails / unicorn / nginx , 40 workers) on it and everything was working well

recently I added a new website app (rails / unicorn / nginx, 2 workers) and since this, I have much less requests for my first website.

htop stats seems to be normal.

[![enter image description here][1]][1]


 How can I find out where is the bottle neck ? Maybe it is link with network, as my second apps is making external requests ? Or maybe IO access as my second apps is 



 How can I find out where is the bottle neck ? Maybe it is link with network, as my second apps is making external requests ? Or maybe IO access as my second apps is also reading and writting in the ssd disk

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/c9a0842e-442e-44a3-a567-8eef41f2df13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Devise docs have a section on configuring multiple models: https://github.com/plataformatec/devise#configuring-multiple-models. If you follow the instructions it should work.

On Wed, May 25, 2016 at 3:50 PM, John Smith <lists@ruby-forum.com> wrote:
I'm building a web site. There will be users and admins. Users will have
their own authentication panel and admins must have absolutely different
authentication entry point and administrative panel. I know how to build
a Rails app with one authentication entry point, but how to make an
application with different authentication entry points e.g. /users/login
& /admin/login? Both panels are not connected with each other and have
absolutely different logic.

Thank you for your answers 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/fbb84343a04636998f87a78eca6d1f15%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Navis
I help tech companies to scale Heroku-hosted Rails apps.

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

Ruby on Rails Wednesday, May 25, 2016

Hello,

Someone had work with this two above gem's ? I wanna add function for saving user_id in session datatable. 

Thanks for help. 

--
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/feca4bee-f2c0-475a-81f7-a67671ccf11f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm building a web site. There will be users and admins. Users will have
their own authentication panel and admins must have absolutely different
authentication entry point and administrative panel. I know how to build
a Rails app with one authentication entry point, but how to make an
application with different authentication entry points e.g. /users/login
& /admin/login? Both panels are not connected with each other and have
absolutely different logic.

Thank you for your answers 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/fbb84343a04636998f87a78eca6d1f15%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

@praveen_k95

thank you for replying.
i know, the update action is blank. but i am trying to edit this post
already made. therefore i am working through edit only.
actually i am trying to follow this tutorial and he is using 1.9.3
version of ROR, and i am working on 4, and thats creating alot of
issues.

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

Ruby on Rails

your update action is blank. You have to render something or redirect to some other page. I mean it has to have some response.

On Wed, May 25, 2016 at 5:20 PM, Dave Aronson <googlegroups.2.TRex@codosaur.us> wrote:
On Wed, May 25, 2016 at 7:40 AM, Aditya Tyagi wrote:

> i am getting the missing template error when i try to update my post.
>
> Missing template posts/update, application/update
...
> POST_CONTROLLER.RB
>
> class PostsController < ApplicationController
...
>   def update
>
>   end

Once you have typical code in the controller to handle updates, you'll
no longer have this problem.  A typical update action redirects to
show on success, and renders the edit template on failure.  Either
one, though, is *explicit*.  As several posters here regularly say, I
recommend you work your way straight through a good tutorial, such as
https://www.railstutorial.org/.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.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/CAHxKQijR24VzWNo_A%2BD37mjhbfLnSAQLA3zKP0U1wTXnQwcN2A%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%2BS_iCvGMvvit5XHNRgUnuE8eENVFZu_2AOsi8BYE0t3yjR7%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Wed, May 25, 2016 at 7:40 AM, Aditya Tyagi wrote:

> i am getting the missing template error when i try to update my post.
>
> Missing template posts/update, application/update
...
> POST_CONTROLLER.RB
>
> class PostsController < ApplicationController
...
> def update
>
> end

Once you have typical code in the controller to handle updates, you'll
no longer have this problem. A typical update action redirects to
show on success, and renders the edit template on failure. Either
one, though, is *explicit*. As several posters here regularly say, I
recommend you work your way straight through a good tutorial, such as
https://www.railstutorial.org/.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.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/CAHxKQijR24VzWNo_A%2BD37mjhbfLnSAQLA3zKP0U1wTXnQwcN2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

i am getting the missing template error when i try to update my post.

Missing template posts/update, application/update with {:locale=>[:en],
:formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw,
:ruby, :coffee, :jbuilder]}. Searched in: *
"c:/Sites/myrubyblog/app/views"

EDIT.HTML.ERB

<h1>Edit Post</h1>


<%= form_for @post do |f| %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %><br />
</p>
<p>
<%= f.label :body %><br />
<%= f.text_area :body %><br />
</p>
<p>
<%= f.select :category_id, Category.all.collect {|x| [x.name,
x.id]}, {:include_blank => "Select One"} %><br />
</p>
<p>
<%= f.submit "Update Post" %><br />
</p>

<% end %>
<% link_to "Go Back",post_path %>
--------------------------------------------------------------

POST_CONTROLLER.RB

class PostsController < ApplicationController
def index
@posts = Post.all
end

def show
@post = Post.find(params[:id])
end

def new
@post = Post.new
@category = Category.all
end

def create
@post = Post.new(post_params)
if @post.save
redirect_to posts_path, :notice => "Your post has been saved"
else
render "new"
end
end

def post_params

params.require(:post).permit(:category_id, :title, :body)

end

def edit
@post = Post.find(params[:id])
end

def update

end

def destroy

end

end

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

Ruby on Rails

I wrote a fairly lengthy post a few minutes ago in the hope of getting some help. But after it was posted I cannot see it in the list of topics in the group. Search results show nothing. Where did it disappear?

Subject line was  'Check if input string conforms with DB collation' and was a question I have already asked on SO with no satisfactory answer.

Regards,
Saurav Kothari

--
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/85001f24-54b6-46c1-87a6-228eba188a3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


What we have is a table with an email field - collation latin1_swedish_ci because of the limitations of our email service.

+----------------+------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field          | Type       | Collation         | Null | Key | Default | Extra          | Privileges                      | Comment |
+----------------+------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+
| id             | int(11)    | NULL              | NO   | PRI | NULL    | auto_increment | select,insert,update,references |         |
| email          | text       | latin1_swedish_ci | YES  |     | NULL    |                | select,insert,update,references |         |
| moved_to_users | tinyint(1) | NULL              | YES  |     | NULL    |                | select,insert,update,references |         |
| created_at     | datetime   | NULL              | YES  |     | NULL    |                | select,insert,update,references |         |
| updated_at     | datetime   | NULL              | YES  |     | NULL    |                | select,insert,update,references |         |
+----------------+------------+-------------------+------+-----+---------+----------------+---------------------------------+---------+

This table is checked when a new user arrives to see if he was already subscribed.


Comes along a user with characters in their email that would not be valid for this particular collation. Take for instance hsıasdf@test.com

mysql> select * from user_subscriptions where email='hsıasdf@test.com';
ERROR 1267 (HY000): Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Would it be possible to determine before saving if a string will adhere to the collation rules of database?

I tried using transactions as mentioned in this SO answer but it does not work or maybe I am not using it right.

I wrapped this in a begin rescue block as a validation method

def validate_collation_again
  email = params[:name].try(:strip)
  begin
    UserSubscription.find_by_email!(email)
  rescue Exception => e
    #handle
  end
end

Is it possible for me to check before any DB trigger to save/create/find; if an entry with this particular email will agree with the collation? Some regex maybe?
String#encode cannot be checked as the application is built using Ruby 1.8.7

This question is also on StackOverflow


Regards,
Saurav Kothari

--
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/473fcf6f-2d88-438b-8d62-9fbc2be633d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, May 24, 2016

I am getting the current error in js console,
TypeError: network_details[network_index] is undefined
help?

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

Ruby on Rails

my SO Link
http://stackoverflow.com/questions/37416737/change-label-based-on-selected-dropdown-ruby-on-rails-4-2

I have a table called network it has the column type and number.

I use this select_tag to get a list of all my network names:

<%= select_tag('NetworksList',
options_from_collection_for_select(Network.all, :id, :name))%>

I also have 2 label fields that I want to populate with information
dynamically:

<p>Network Type: <%= content_tag('span', "", id: 'NetworkType') %></p>
<p>Network Number: <%= content_tag('span', "", id: 'NetworkNumber')
%></p>

When the user selects a network from the dropdown list of network names,
I want to show the selected item's type and number in the fields named
NetworkType and NetworkNumber. I would like this to render in the view
immediately after the user selects a dropdown. How would I do this?

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

Ruby on Rails

I have a search view which collects a search term from a user and then passes them to the search result view.  The results view is constructed in two parts:

1) basic server side rendering which builds the overall structure of the page and includes a search form
2) ActionCable delivers rendered search results after the longish running search has completed, these views also contain a form

The form from bullet 1 works as expected.  The form(s) from bullet 2 fail CSRF checks.

My understanding is that CSRF tokens are added to the session when the page is rendered.  As such, the first form works as it has reference to the session.  The forms generated in bullet 2 are done so by ActiveJob and then the rendered view is delivered to the browser via ActionCable.  I believe that there is no session mapping here.

Can anyone suggest a good approach to correctly allowing form submission with CSRF prevention in place on a form delivered asynchronously from an ActiveJob via ActionCable?

I know I can get the browser to re-write the async tokens with javascript but that feels like quite a hack.

Thanks,
Dave 

--
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/9caa4214-58db-4547-8c30-d458531c7cf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think it depends on your use case. Things to consider:

1. Selecting all comments of a user via 1 association or N associations (and 1 vs N queries).
2. Storing more data in the table (:commentable_type).
3. Maintaining and testing one model vs testing N models.

I think the biggest problem with separate comment models is that references from other models are the fact that you need N times more associations to reference a comment (e.g. user.post_comments, user.picture_comments, ... instead of user.comments).

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

Ruby on Rails



On Monday, May 23, 2016 at 1:12:33 PM UTC+1, Alessio Varalta wrote:

If i put in the model


serialize :birthplace, Hash


is correct but i have a diffrent format {:it=>"Padova",:de=>"Padovan"}


I read in the last part of this document

http://apidock.com/rails/ActiveRecord/AttributeMethods/Serialization/ClassMethods/serialize 

that Yaml is the default serialization and generate a string ---\n....



This is the right thing to do. You don't see the yaml in your app because rails is doing the conversion to/from yaml for you. If you were to look at your column with a non rails database tool then you would see the raw serialised data.

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/f8dbdd59-9bd6-487b-93c2-1326ee9418a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


On 23 May 2016 10:05 p.m., "saurabh verma" <saurabh.vrm@gmail.com> wrote:
>
> Hey Guys,
>    I am running a service which has one controller action. I am connected to external db. For any db query, I am getting slow response. Looks like execution time is ok, but still there is some other delay which I am not able to figure out. When I am running this endpoint I am getting the following rails logging statement. I can understand active_record time, but don't know the remaining response time. I also tried to get the time spend for the method function1(mentioned in the below code), which is exactly same as total time(3561 ms)
>
> Completed 200 OK in 3561.5ms (Views: 0.3ms | ActiveRecord: 644.8ms)
>
>
>
> Here is my code
>
> class MyModel < ActiveRecord::Base
>
>    if Rails.env != 'test'
>      establish_connection("#{Rails.env}")
>    end
>   
>   class << self  
>     def function1
>       self.first
>     end
>   end
> end
>
> database.yml
>
> development:
>   adapter: 'sqlserver'
>   mode: 'dblib'
>   host: 'MyHost'
>   username: 'username'
>   password: 'secret'
>   database: 'MyDB'
>   pool: 1
>

Write a simple shell script to connect and run a query and see how long that takes. That will tell you if it is an issue connecting to the remote db

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/be80bab3-a44e-40ae-9eb8-04335df5fed8%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%3D0gLsnSGaRUL7LUZgtBFft3rv7%2BOcmX5rM4RGzyiYap%2BivaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.