Well, yes, the point of caching is to trade memory for performance.
memcached is very scalable - for example, one popular social networking service reported in 2008 that they operated over 800 memcached servers, delivering 28TB of available cache memory.
Params seem very helpful. From the controller, is it possible to filter public activity by params (for example, storing the recipe in the params and only showing public activity for a recipe on that recipe's page)?
I see in the episode that Ryan filtered directly by one of the attributes (owner_id):
ruby
defindex@activities = PublicActivity::Activity.order("created_at desc").where(owner_id: current_user.friend_ids, owner_type:"User")
end
I see that I can store the recipe_id from within the recipe controller similar to what was mentioned in the episode:
I see that it's possible to filter this way in the view (replacing "123" below with the particular recipe's id, but I'm assuming it's better to do this in the controller, yes?
You're saying multiple times that the cached values are expired, that's a bit false I think.
The cache key changes and there is no cached value with the new key, but the cached value with the old key is still cached in there. It can grow big if not expired from time to time.
Also a couple of gotcha's was default scope and multiple includes.
We had to run the text_search as 'unscoped.where' and remove a couple of includes before any search results would displayed.
This app had one search query only on strings such as names, usernames, and email addresses (no full text searches). so we incorporated Ryan's Auto Completion:
I don't think this is a good idea. What if a user changes a password because it was compromised? - You would need to change the member ID to log them out which is a really bad idea.
I developed a wizard using Angular JS. It is extremely simple and requires less code. It allows users to go back and change previous values. It's on github: https://github.com/bparanj/angular-wizard
Hi Guys,
Not sure how scalable model caching is?
In a sense, it looks like we are building a "cached mini DB"..
in a scenario with thousands (or millions) of records , you will end up requiring more and more memory.
Exactly! Thanks for the tip. Just restarting the server made it work.
Ryan,
Are you planning on doing an update for Rails 4 compatibility?
cheers.
d
When a memcached server runs low on memory, it simply removes the oldest data.
Well, yes, the point of caching is to trade memory for performance.
memcached is very scalable - for example, one popular social networking service reported in 2008 that they operated over 800 memcached servers, delivering 28TB of available cache memory.
I can't get it to work when i add this into my app.
undefined method `import' for
i have gone at it over and over -- and nothing.
-- though I can get it to work using the supplied source code.
please assist -- i have lots of content entered in good cspreadhseets taht I need to enter into my site.
thx,
sg
My import button is not showing up in any browsers. I used this snippet in my customer.rb
and this in my index.html.erb
Any thoughts?
Great gem.
Params seem very helpful. From the controller, is it possible to filter public activity by params (for example, storing the recipe in the params and only showing public activity for a recipe on that recipe's page)?
I see in the episode that Ryan filtered directly by one of the attributes (owner_id):
I see that I can store the recipe_id from within the recipe controller similar to what was mentioned in the episode:
I see that it's possible to filter this way in the view (replacing "123" below with the particular recipe's id, but I'm assuming it's better to do this in the controller, yes?
Thank you thank you thank you! I've been stuck on this for hours!
my mistake the log says "Unpermitted parameters: utf8, authenticity_token, venue, commit" but I had an error in my code which compounded things
You're saying multiple times that the cached values are expired, that's a bit false I think.
The cache key changes and there is no cached value with the new key, but the cached value with the old key is still cached in there. It can grow big if not expired from time to time.
I am trying to use Strong_parameters with Ajax & I get the following
Unpermitted parameters: utf8, if I do not include it in the permitted or
ActiveRecord::UnknownAttributeError (unknown attribute: authenticity_token): if I do
Is this me or a Work in progress I can make it work for a html form.
puts "<%= simple_form_for(@venue, remote: true ) do |f| %>"
Try bbarton's suggestion - it worked for us.
Also a couple of gotcha's was default scope and multiple includes.
We had to run the text_search as 'unscoped.where' and remove a couple of includes before any search results would displayed.
This app had one search query only on strings such as names, usernames, and email addresses (no full text searches). so we incorporated Ryan's Auto Completion:
http://railscasts.com/episodes/102-auto-complete-association-revised
It works great. Thank's Ryan!
A big thank you - worked for me
Hi
Can anyone tell how to export 100,000 records of data to csv in seconds.
Thanks in advance.
Thanks, I couldn't get the handler to open sublime, this should work for now
Thank you so much Daniele. Is this issue with new jquery version only.
Thanks,
Shyam
http://about.me/shyam_visamsetty
I don't think this is a good idea. What if a user changes a password because it was compromised? - You would need to change the member ID to log them out which is a really bad idea.
Hi, I got this question. What if in the bar action, instead of saying
The developer can just type as:
Is my last code considered to be thread-safe?
In Java, we may need to put a keyword 'volatile' on variables of an object which is shared across different threads. What about Ruby in our case ??
Thanks if you could let me know
What about controller testing? - I have a bunch of integration tests with capybara which are great, but not sure how to write the controller tests.
Indeed! Thanks for posting about the update.
Help please,
followed the tutorial but when I use cap rubber:create_staging I get the following error:
Creating instance ami-b6089bdf/c1.medium/likeme_production_default,likeme_production_web,likeme_production_web_tools,likeme_pr
oduction_production,likeme_production_apache,likeme_production_app,likeme_production_passenger,likeme_production_collectd,likeme_p
roduction_common,likeme_production_monit,likeme_production_db,likeme_production_postgresql,likeme_production_postgresql_master,lik
eme_production_elasticsearch,likeme_production_examples,likeme_production_graphite_server,likeme_production_graphite_web,likeme_pr
oduction_graylog_elasticsearch,likeme_production_graylog_mongodb,likeme_production_mongodb,likeme_production_graylog_server,likeme
_production_graylog_web,likeme_production_haproxy/us-east-1
/home/alon/.rvm/gems/ruby-1.9.3-p429/gems/excon-0.22.1/lib/excon/middlewares/expects.rb:10:in `response_call': Expected(200) <=> A
ctual(400 Bad Request) (Excon::Errors::BadRequest)
A BIG Thank You! - Worked for me!
How do I do the same for a authorized user, I've got the following in my controller, model, and index;
As you've guessed it, I'm trying to use a refresh button to pull the route /refresh which runs the controller, that runs the model??
Not sure I'm doing this right. However, going in the console with the following command;
I get an error: NameError: uninitialized constant User::Newtweet
Should I be moving the self.pull_tweets stuff into a controller??
Any suggestions, thank you!
Is there an easy way to populate my database with the test data shown in the screencast?
Thanks in advance!
What a name I thought this screen cast was going to be about Borland JBuilder(late 90's editor) ;)
I`m clone repo
git@github.com:railscasts/381-jquery-file-upload.git
bundle
rake db:migrate
rails s
but js and css file does`t load.
If I look at the source code of a site:
link href="/assets/application-7270767b2a9e9fff880aa5de378ca791.css" media="screen" rel="stylesheet" type="text/css" /
script src="/assets/application-673db32530fb40e931676ebc22eaebc6.js" type="text/javascript"/script
Why don`t load other js/css file?
Put this at the top of your model which inherits from
ActiveResource
This worked for me as well. Thanks!
After upgrading to the latest jquery and adding Facebook 'Like' buttons, the sign-in popup window stopped functioning.
Firebug reported:
FB.getLoginStatus() called before calling FB.init().
To fix this, just move the "FB.init" call to the last position in facebook.js.coffee.erb.
Worked for me - not sure why.
rake assets:clean and rake:assets:precompile to override the bootstrap_and_overrrides.css.less
You're a lifesaver! Spent too long figuring this out, and was starting to suspect it was a versioning issue.
I developed a wizard using Angular JS. It is extremely simple and requires less code. It allows users to go back and change previous values. It's on github: https://github.com/bparanj/angular-wizard
Hi Guys,
Not sure how scalable model caching is?
In a sense, it looks like we are building a "cached mini DB"..
in a scenario with thousands (or millions) of records , you will end up requiring more and more memory.
Thanks for the reply and sorry for the slow response. That was great link.
I found https://github.com/faye/faye/wiki/Deploy-Best-Practices
Nice. Any idea on how to deploy with Capistrano? I didn't find recipes.
Many thanks in advance.
take a look in my commet
For all the guys with this problem:
"Validation failed: Password can't be blank, Password is too short minimum is 6
characters"
the solution is just change the line
and use instead
Ryan, there is one hidden bug in this episode.
Is:
Should be:
You won't see any difference unless you try writing partials in Markdown. I'm on Rails 3.2.12.
A BIG Thank You Egbert! - Worked for me!
Maybe this can help those like Michael Elfassy, SMnetserv, pbaileyjr12 who have difficulty with double named countries.
On my app, everything worked fine until I accidentally 'bundle update' the gems.
After the bundle update, the double name countries (United States and United Kingdom) would not trigger and display the:
grouped_collection_select :state_id, Country.approved.includes(:states)
sidenote: bullet says to include states in the query.
I hope this helps:
Very useful. Thank you
Thanks! Was having trouble setting this up, great episode and much appreciated : )
Thanks for reporting this error in the ASCIIcast, I have corrected it.
In an act of shameless self promotion, I'd like you to promote http://pulsar.nebulab.it
You can use it to organize capistrano recipes and configurations. Maybe you'll find it useful.
+1
Hey it will be great to make a new video for thinking sphinx, a lot of things changed so your video is no longer relevant.
If you're getting an endless loop of updating, change to:
The helper_method part does not work using Rails API's controller:
This is because ActionController::API#helper_method is simply a stub that does nothing.
I just needed to include AbstractController::Helpers in my ApplicationController to make it work.
Thank you, I had run into the same issue. This fixed it.