I liked this episode but would really like to see how one would approach the has_many model situation and nested forms with angularJs. I cant find anything that can help me save the attributes from one model plus the nested model.
I have a site using pg_search and GIN indexes per this screencast. Recently I changed the pg_search_scope on a model to use the "simple" dictionary instead of "english". So then, do I need to write a new migration to update the GIN indexes as well since those indexes refer to_tsvector "english"?
Simplified example below.
class ChangeIndexesOnClients < ActiveRecord::Migration
def up
execute "drop index clients_name"
execute "create index clients_name on clients using gin(to_tsvector('simple', name))"
end
def down
execute "drop index clients_name"
execute "create index clients_name on clients using gin(to_tsvector('english', name))"
end
end
Meteor currently is heavily reliant on mongodb because it uses minimongo on the front end. I believe there are a few groups looking to implement a Postgres version on the backend. I think Mongo makes Meteor better because it forces you to design your applications with speed in mind.
Has anyone gotten the S3 direct upload version at the end with Rails 4? The uploading works, but the page doesn't get updated without a refresh, and I don't see the progress bars.
I'm getting a 500 error on my heroku site and a 401 error on my localhost. My site links to Twitter and allows log ins but returns a "Could not authenticate you from Twitter because "Invalid credentials"". I am 100% sure the keys are correct. Any advice?
Are you planning on doing a video that shows how to both use the User authentication as well as a separate Admin Auth that can manage all the Users that exist within the database?
How can I get cancan to lookup activerecords when I'm using the has_permalink gem?
If I access a url by it's has_permalink ID, example - articles/my-article-name/edit I get an error saying it can't find an article with that ID but when I access the article using the ID number it works fine.
I'm running postgresl 9.2.1 on Mac OS X, installed by homebrew and Rails 3.2.12
The postrgresql lib directory has unaccent.so
But it is not installed by default and Ryan's migration did not seem to do anything.
What worked for me was:
bash
$ rails db
my_db=# create extension unaccent;
my_db=# \dx
List of installed extensions
Name | Version | Schema | Description
----------+---------+------------+---------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
unaccent | 1.0 | public | text search dictionary that removes accents
People, I am having a little problem, I think that is because de turbolinks, when I click in the new task link more than one form is showed to me, anyone can help me? when i disable turbolink, everything it's OK
We had the idea to implement a notification pushing mechanism based on the ActionController::Live functionalities. Basically everything works fine from the functional perspective.
But: Am I the only one who doesn't want to accept that you have to restart your development web server (Puma) every time you change something in your code?
For me this is highly uncomfortable. Does anybody else encounters the same problem? Maybe there's a solution for this somewhere out there that I can't get hold of right now?
I needed this as well. I've managed to make it work (with Facebook anyway - but it should be trivial to support other providers as well). Code at: https://gist.github.com/troelskn/6240837
using the pubsub approach within the ActionController::Live we ended up with a lot of Threads that are never closed. I think Redis subscribe and psubscribe are blocking the created Thread and stream.close will never be called, will check this soon.
What we've noticed gets even worse with new visitor and each page reload we ended up with a new Thread. At the end we had many Threads sleeping consuming all available Threads for puma.
I can get the sample data working in my Rails app (3.2.14), but when I try with real data, the chart doesn't show up. It appears my JSON string has an extra level of nesting in it, where it's {model_name: {properties}}, you can see my code and an example in my Gist. Any help is greatly appreciated!
Thanks for the screencast. I'm just wondering...is there a simple way to implement this while using devise? Right now, I'm thinking that I'd have to kind of hack the out my own create method in the UserRegistrationController that devise comes with.
Available Commands: [waiting] [crashed] [ready]
zeus destroy (alias: d)
zeus generate (alias: g)
zeus rake
zeus server (alias: s)
zeus console (alias: c)
zeus dbconsole
zeus runner (alias: r)
zeus cucumber
zeus test (alias: rspec, testrb)
exit status 1
Thanks for sharing this piece of info about default new ids created by Rails.
Sadly, I am getting ActiveModel::ForbiddenAttributesError when I try to use this recipe in Rails 4. Any idea how to update it for Rails 4?
do you have the gem in the assets group? Rails 4 has done away with the assets group so try removing that group and running bundle install again.
Hi Ryan,
I liked this episode but would really like to see how one would approach the has_many model situation and nested forms with angularJs. I cant find anything that can help me save the attributes from one model plus the nested model.
Another awesome cast - I love how in the end there are no queries!
I found a replacement for
request.path[1..-1]
posted by Jeroen Rosenberg:I have a site using pg_search and GIN indexes per this screencast. Recently I changed the pg_search_scope on a model to use the "simple" dictionary instead of "english". So then, do I need to write a new migration to update the GIN indexes as well since those indexes refer to_tsvector "english"?
Simplified example below.
https://github.com/SamSaffron/MiniProfiler/tree/master/Ruby now supports mongoid 3
+1, works in Firefox, but not in IE or Chrome.
Yes I was having this issue. I got around it with the following:
Meteor currently is heavily reliant on mongodb because it uses minimongo on the front end. I believe there are a few groups looking to implement a Postgres version on the backend. I think Mongo makes Meteor better because it forces you to design your applications with speed in mind.
Same for me.
I renamed my
:allow
and:allow_params
matchers to:permit
and:permit_params
to get past this error.Here's my spec/support/matchers.rb file.
And my specs look like this (
should permit(...
instead ofshould allow(...
)But how do you render something in full JS ? Using render_to_string and sending a JSON ? An other solution or example ?
Has anyone gotten the S3 direct upload version at the end with Rails 4? The uploading works, but the page doesn't get updated without a refresh, and I don't see the progress bars.
Perhaps it has something to do with Turbolinks?
Any help would be much appreciated.
I'm getting a 500 error on my heroku site and a 401 error on my localhost. My site links to Twitter and allows log ins but returns a "Could not authenticate you from Twitter because "Invalid credentials"". I am 100% sure the keys are correct. Any advice?
Not perfect but this kinda works.
http://stackoverflow.com/questions/13128485/pretty-print-json-generated-with-a-jbuilder-template-in-rails-3-2-8
This looks like an option as well.
http://stackoverflow.com/questions/86653/how-can-i-pretty-format-my-json-output-in-ruby-on-rails/13029297#13029297
and I get it from here: https://github.com/dwilkie/carrierwave_direct/issues/97
+1
did you set environment varilables for TWITTER_SECRET and TWIITTER_KEY based on what you set up on the dev.twitter.com site?
Seems like he's doing fine now. Railscasts has become a great service. Great job Ryan.
Wow, thanks!
I tried to figure out what's wrong with my headers for 20 mins before I decided to check the internets. You saved my day!
If you're having problems with some jQueries you can try the jQuery-Turbolinks gem: https://github.com/kossnocorp/jquery.turbolinks/
It seems for some people
subl-handler
doesn’t work as expected. Here’s my two cents: https://github.com/exalted/sublimetext-launcherSorry for the content-free post but just had to say, that was an amazing episode, thank you Ryan :)
Are you planning on doing a video that shows how to both use the User authentication as well as a separate Admin Auth that can manage all the Users that exist within the database?
Thank you for awesome screencast. I got inspired and wrote little more enhanced version of this (for example fallback to generic error message layout, and hiding 500 error messages in production): https://github.com/sheerun/rails4-bootstrap/commit/5c2df5a108ad204bc407183b959bb355ff5ed53d
How can I get cancan to lookup activerecords when I'm using the has_permalink gem?
If I access a url by it's has_permalink ID, example - articles/my-article-name/edit I get an error saying it can't find an article with that ID but when I access the article using the ID number it works fine.
Is this safe to put these credentials on dom:
If you are having issues getting started with Rubber take a look at this post. I had a few issues getting started and this is how I resolved them.
http://www.flaskofespresso.com/2013/08/rails-rubber-aws-ec2-deployment-issues-with-groups-and-rules/
There is a typo in the ASCIIcast; In the code block for adding the default url options it's specified as "- { host" but should be "= { host".
I'm running postgresl 9.2.1 on Mac OS X, installed by homebrew and Rails 3.2.12
The postrgresql lib directory has unaccent.so
But it is not installed by default and Ryan's migration did not seem to do anything.
What worked for me was:
Good screencast. However, one thing left out that was mentioned in the original ones is the
:reject_if => :all_blank
in the model.+1
Can you tell us what an alternative would be?
Some notes on SignupForm. Each model has its own validations. When I want to use the same validations I should copy-past them?
Yes there is a way, I recommend only to use in development, it has some drawbacks.
Hi, I'm encountering a redirect loop when logging in. Has anyone encountered this before? I'm using Rails 4 BTW. Thanks!
Just to clarify for anyone else reading this,
↵
is the HTML entity for carriage return. The line in your Gemfile should be:Did you ever get this one figured out?
People, I am having a little problem, I think that is because de turbolinks, when I click in the new task link more than one form is showed to me, anyone can help me? when i disable turbolink, everything it's OK
Hi there - how do you specify the authentication to use in your "# use http_basic_authentication" ?
I.e. when inside the JSON case, what is the next step to authorise the request? Currently I'm really struggling getting a JSON API via HTTP basic auth
First of all: Great episode again, Ryan - thanks!
We had the idea to implement a notification pushing mechanism based on the ActionController::Live functionalities. Basically everything works fine from the functional perspective.
But: Am I the only one who doesn't want to accept that you have to restart your development web server (Puma) every time you change something in your code?
For me this is highly uncomfortable. Does anybody else encounters the same problem? Maybe there's a solution for this somewhere out there that I can't get hold of right now?
I needed this as well. I've managed to make it work (with Facebook anyway - but it should be trivial to support other providers as well). Code at: https://gist.github.com/troelskn/6240837
Note that this is for Rails 4.
If you are on Rails 4 and get a cryptic error message along the lines of
ArgumentError in Devise::RegistrationsController#new wrong number of arguments (2 for 1)
, just remove thewithout_protection
key inuser.rb
. Source: http://stackoverflow.com/questions/17105112/argumenterror-in-deviseregistrationscontrollernew-wrong-number-of-argumentsHi Ryan,
using the pubsub approach within the ActionController::Live we ended up with a lot of Threads that are never closed. I think Redis subscribe and psubscribe are blocking the created Thread and stream.close will never be called, will check this soon.
What we've noticed gets even worse with new visitor and each page reload we ended up with a new Thread. At the end we had many Threads sleeping consuming all available Threads for puma.
There is also an issue at github addressing this: https://github.com/rails/rails/issues/10989#issuecomment-21305888
I can get the sample data working in my Rails app (3.2.14), but when I try with real data, the chart doesn't show up. It appears my JSON string has an extra level of nesting in it, where it's {model_name: {properties}}, you can see my code and an example in my Gist. Any help is greatly appreciated!
Thanks for the screencast. I'm just wondering...is there a simple way to implement this while using devise? Right now, I'm thinking that I'd have to kind of hack the out my own create method in the UserRegistrationController that devise comes with.
i'm getting "exit status 1" for jruby
but on a high note works great for ruby-1.9.3
Hi all. Question:
I have my root to "entries#index"
When I paginate entries with <%= paginate @entries %> visiting the root (/), the pages links goes to /entries?page=N instead to root as /?page=N.
How would I tell kaminari to do that?
Thanks!