Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread fugee ohu
The error's caused by the routine ensure_canonical_url If I comment it out 
it works

blog_post.rb:

  def to_param
   "#{id}-#{title.parameterize}"
  end

blog_posts_controller.rb:

def set_blog_post
  @blog_post = BlogPost.find(params[:id])
end

def ensure_canonical_url
  redirect_to @blog_post if @blog_post.to_param != params[:id]
end


On Wednesday, January 15, 2020 at 8:41:00 PM UTC-5, Ariel Juodziukynas 
wrote:
>
> I insist, show your code, show the complete error stacktrace, show the 
> log. I can imagine what you are trying to do and from the (little) code you 
> show it should work so something else is messing things up but you are 
> showing barely any relevant code.
>
> El mié., 15 ene. 2020 a las 22:37, fugee ohu ( >) escribió:
>
>>
>>
>> On Wednesday, January 15, 2020 at 8:26:45 PM UTC-5, Ariel Juodziukynas 
>> wrote:
>>>
>>> find method doesn't care about the to_param method, it just takes the 
>>> parameter you use, I guess it calls "to_i" and uses that integer to query 
>>> the id column
>>>
>>> Why don't you show your code, the stacktrace, the logs or anything? I 
>>> suggest you read something like stackoverflow's guidelines on how to ask, 
>>> you posts are usually really hard to understand and a lot of information is 
>>> missing
>>>
>>> El mié., 15 ene. 2020 a las 18:01, fugee ohu () 
>>> escribió:
>>>


 On Wednesday, January 15, 2020 at 3:07:00 PM UTC-5, Ariel Juodziukynas 
 wrote:
>
> From the docs: 
> https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find
>
> Person .find 
> ("31-sarah") # 
> returns the object for ID = 31
>
> In your case, if you are using find, it should search for record with 
> id = 18
>
> El mié., 15 ene. 2020 a las 16:18, fugee ohu () 
> escribió:
>
>> Doesn't work for me in rails 6
>>
>>   Parameters: {"id"=>"18-test-title"}
>>  ActionController::ActionControllerError (Cannot redirect to nil!):
>>
>> Ne
>>
>> -- 
>> 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 rubyonra...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com
>>  
>> 
>> .
>>
>
 I've over-riding ActiveRecord to_param in my model

   def to_param
"#{id}-#{title.parameterize}"
   end

 -- 
 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 rubyonra...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/1ba590e7-4c1c-4fcd-9ed8-0f2ed65b0350%40googlegroups.com
  
 
 .

>>>
>> I was trying to implement this guide:
>>
>> https://medium.com/badass-engineer/seo-friendly-urls-with-rails-49cfcd2fb190
>>
>> -- 
>> 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/1aa0ed3a-a906-4965-8ff1-c8fde1e909da%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/36bef75c-1c04-4bdd-a43b-52194db1d431%40googlegroups.com.


Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread Ariel Juodziukynas
I insist, show your code, show the complete error stacktrace, show the log.
I can imagine what you are trying to do and from the (little) code you show
it should work so something else is messing things up but you are showing
barely any relevant code.

El mié., 15 ene. 2020 a las 22:37, fugee ohu ()
escribió:

>
>
> On Wednesday, January 15, 2020 at 8:26:45 PM UTC-5, Ariel Juodziukynas
> wrote:
>>
>> find method doesn't care about the to_param method, it just takes the
>> parameter you use, I guess it calls "to_i" and uses that integer to query
>> the id column
>>
>> Why don't you show your code, the stacktrace, the logs or anything? I
>> suggest you read something like stackoverflow's guidelines on how to ask,
>> you posts are usually really hard to understand and a lot of information is
>> missing
>>
>> El mié., 15 ene. 2020 a las 18:01, fugee ohu ()
>> escribió:
>>
>>>
>>>
>>> On Wednesday, January 15, 2020 at 3:07:00 PM UTC-5, Ariel Juodziukynas
>>> wrote:

 From the docs:
 https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find

 Person .find 
 ("31-sarah") # 
 returns the object for ID = 31

 In your case, if you are using find, it should search for record with
 id = 18

 El mié., 15 ene. 2020 a las 16:18, fugee ohu ()
 escribió:

> Doesn't work for me in rails 6
>
>   Parameters: {"id"=>"18-test-title"}
>  ActionController::ActionControllerError (Cannot redirect to nil!):
>
> Ne
>
> --
> 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 rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com
> 
> .
>

>>> I've over-riding ActiveRecord to_param in my model
>>>
>>>   def to_param
>>>"#{id}-#{title.parameterize}"
>>>   end
>>>
>>> --
>>> 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 rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/1ba590e7-4c1c-4fcd-9ed8-0f2ed65b0350%40googlegroups.com
>>> 
>>> .
>>>
>>
> I was trying to implement this guide:
>
> https://medium.com/badass-engineer/seo-friendly-urls-with-rails-49cfcd2fb190
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/1aa0ed3a-a906-4965-8ff1-c8fde1e909da%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcAhMWv_1GduYuKyRe5D%3DexpX_ata7B-kL0fnTwFRc86Tg%40mail.gmail.com.


Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread fugee ohu


On Wednesday, January 15, 2020 at 8:26:45 PM UTC-5, Ariel Juodziukynas 
wrote:
>
> find method doesn't care about the to_param method, it just takes the 
> parameter you use, I guess it calls "to_i" and uses that integer to query 
> the id column
>
> Why don't you show your code, the stacktrace, the logs or anything? I 
> suggest you read something like stackoverflow's guidelines on how to ask, 
> you posts are usually really hard to understand and a lot of information is 
> missing
>
> El mié., 15 ene. 2020 a las 18:01, fugee ohu ( >) escribió:
>
>>
>>
>> On Wednesday, January 15, 2020 at 3:07:00 PM UTC-5, Ariel Juodziukynas 
>> wrote:
>>>
>>> From the docs: 
>>> https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find
>>>
>>> Person .find 
>>> ("31-sarah") # 
>>> returns the object for ID = 31
>>>
>>> In your case, if you are using find, it should search for record with id 
>>> = 18
>>>
>>> El mié., 15 ene. 2020 a las 16:18, fugee ohu () 
>>> escribió:
>>>
 Doesn't work for me in rails 6

   Parameters: {"id"=>"18-test-title"}
  ActionController::ActionControllerError (Cannot redirect to nil!):

 Ne

 -- 
 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 rubyonra...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com
  
 
 .

>>>
>> I've over-riding ActiveRecord to_param in my model
>>
>>   def to_param
>>"#{id}-#{title.parameterize}"
>>   end
>>
>> -- 
>> 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/1ba590e7-4c1c-4fcd-9ed8-0f2ed65b0350%40googlegroups.com
>>  
>> 
>> .
>>
>
I was trying to implement this guide:
https://medium.com/badass-engineer/seo-friendly-urls-with-rails-49cfcd2fb190

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1aa0ed3a-a906-4965-8ff1-c8fde1e909da%40googlegroups.com.


Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread Ariel Juodziukynas
find method doesn't care about the to_param method, it just takes the
parameter you use, I guess it calls "to_i" and uses that integer to query
the id column

Why don't you show your code, the stacktrace, the logs or anything? I
suggest you read something like stackoverflow's guidelines on how to ask,
you posts are usually really hard to understand and a lot of information is
missing

El mié., 15 ene. 2020 a las 18:01, fugee ohu ()
escribió:

>
>
> On Wednesday, January 15, 2020 at 3:07:00 PM UTC-5, Ariel Juodziukynas
> wrote:
>>
>> From the docs:
>> https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find
>>
>> Person .find 
>> ("31-sarah") # 
>> returns the object for ID = 31
>>
>> In your case, if you are using find, it should search for record with id
>> = 18
>>
>> El mié., 15 ene. 2020 a las 16:18, fugee ohu ()
>> escribió:
>>
>>> Doesn't work for me in rails 6
>>>
>>>   Parameters: {"id"=>"18-test-title"}
>>>  ActionController::ActionControllerError (Cannot redirect to nil!):
>>>
>>> Ne
>>>
>>> --
>>> 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 rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com
>>> 
>>> .
>>>
>>
> I've over-riding ActiveRecord to_param in my model
>
>   def to_param
>"#{id}-#{title.parameterize}"
>   end
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/1ba590e7-4c1c-4fcd-9ed8-0f2ed65b0350%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDQU%2BQLcCOftreFJb0UdUFYUYPAFM%3DCm1xCO2qomsQ6Ag%40mail.gmail.com.


[Rails] Hiring for Top Companies in Bay Area

2020-01-15 Thread Aamil Saiyed
Ruby on Rails Developers to Engineering Managers and Directors. Direct hire 
opportunities only. Location: San Francisco
Compensation: Open to Market + Equity
My all clients are backed by Heavy VC findings upto 8 million and they have a 
valuation of 1 Billion. 
Get your dog to office. Enjoy drinks and free food at work. 
Email me at aamil.sai...@collabera.com
Or call me at +1-470-447-2384

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/8e63a56c-9962-4eca-a410-003d7a6c5fe5%40googlegroups.com.


Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread fugee ohu


On Wednesday, January 15, 2020 at 3:07:00 PM UTC-5, Ariel Juodziukynas 
wrote:
>
> From the docs: 
> https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find
>
> Person .find 
> ("31-sarah") # 
> returns the object for ID = 31
>
> In your case, if you are using find, it should search for record with id = 
> 18
>
> El mié., 15 ene. 2020 a las 16:18, fugee ohu ( >) escribió:
>
>> Doesn't work for me in rails 6
>>
>>   Parameters: {"id"=>"18-test-title"}
>>  ActionController::ActionControllerError (Cannot redirect to nil!):
>>
>> Ne
>>
>> -- 
>> 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com
>>  
>> 
>> .
>>
>
I've over-riding ActiveRecord to_param in my model

  def to_param
   "#{id}-#{title.parameterize}"
  end

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1ba590e7-4c1c-4fcd-9ed8-0f2ed65b0350%40googlegroups.com.


Re: [Rails] [JOBS] Ruby on Rails developer - Remote OK

2020-01-15 Thread Sampson Crowley
This really sounds like an interesting position that ticks all of my boxes
and vice versa. Feel free to contact me at any time to discuss needs and
expectations.

On Sun, Jan 12, 2020 at 10:55 AM Siva Gopalreddy <
sivagopalreddy...@gmail.com> wrote:

> Hi ,
> I am interested for this position.
>
> On Tue, 7 Jan, 2020, 3:10 am Emanuele Tozzato,  wrote:
>
>>
>>- AINZ Corp. is a boutique software development, R and consultancy
>>company focused exclusively on software (LIMS) for laboratories that 
>> engage
>>in cannabis testing;
>>- We are looking for an experienced developer to join us (part time
>>contract to full time hire) and potentially take the tech lead for the
>>final development phase of our latest product, CannabisLIMS :: LABFLOW
>>;
>>- Our SAAS is currently in production, in alpha stage and requires
>>feature refinement and test coverage increase.
>>- Our stack is Rails 5 with PostgreSQL and we do a heavy use of the
>>Active Admin Gem. We are a frugal, distributed team with our operational
>>headquarter in Portugal.
>>
>>
>> Feel free to contact me directly with any question, *no recruiters, no
>> agencies please. *
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/rubyonrails-talk/bab74780-0d98-4134-84c7-8bbd6201aca7%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2B1g4VjP76jnbfpswtu1zgQvXbkPxVq9z6hwkmoAincOwp6eZA%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAM5L8qOta4brGMO83vEUo%3D8OYc6Q4Amyn02o2yrvGkUzrGVwYw%40mail.gmail.com.


Re: [Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread Ariel Juodziukynas
>From the docs:
https://apidock.com/rails/v6.0.0/ActiveRecord/FinderMethods/find

Person .find
("31-sarah")
# returns the object for ID = 31

In your case, if you are using find, it should search for record with id =
18

El mié., 15 ene. 2020 a las 16:18, fugee ohu ()
escribió:

> Doesn't work for me in rails 6
>
>   Parameters: {"id"=>"18-test-title"}
>  ActionController::ActionControllerError (Cannot redirect to nil!):
>
> Ne
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcA8PH7D9tzqAWTWLF0gK8vYUrO4G5xjJa3rgM41rxP-cw%40mail.gmail.com.


[Rails] ActiveRecord find ignores extra characters after numeric id. ?

2020-01-15 Thread fugee ohu
Doesn't work for me in rails 6

  Parameters: {"id"=>"18-test-title"}
 ActionController::ActionControllerError (Cannot redirect to nil!):

Ne

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/64e66550-c393-43cd-8156-29c43139899a%40googlegroups.com.