I'm having trouble with the remove link in production. The fieldset remove works however it still triggers validation even though it is no longer visible on the screen. Am i missing a step?
I think this is one of the very few resources out there that explains how rails is constructed. And it does so in the Ryan Bates's concise-yet-thorough style.
Having this primer will save so much time reading through the rails source code.
How would you implement chosen or select2 if your has_many through join table is not using the default id as a primary key? Is the syntax author_ids something rails handles automagically in the standard join table?
Hi Ryan...This tutorial is really AWESOME..I'm just a newbie in rails but I never had a hard time understanding your tutorials...I have a question, Can I automate the rake task that index the search suggestions by event or by time?..Thanks in advance..
I didn't get it working with just Capistrano 3, because Capistrano doesn't want to use the sudo command a lot, and now recommends passwordless sudo. However, I made it work by provisioning with Sunzi. I made a how to video you can follow.
Agree! It would be awesome! Been trying to setup Elasticsearch with the new Elasticsearch rails gem, but not finding enough/clear documentation on how to migrate from Tire. Railscasts are awesome!
When I try to generate the access token in the irb console, I get "DNS lookup failed error". Does this have to do with some problem in my machine setup?
ruby
irb(main):021:0> access = client.auth_code.get_token("6246e2d200c46b338780e72c4db85f5225c097e907792c31f7acf9b07421fe7f", redirect_uri: callback)
OAuth2::Error: <!-- IE friendly error message walkround.
if error message from server is less than
512 bytes IE v5+ will use its own error
message instead of the one returned by
server. -->
<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">html,body{height:100%;padding:0;margin:0;}.oc{display:table;width:100%;height:100%;}.ic{display:table-cell;vertical-align:middle;height:100%;}div.msg{display:block;border:1px solid #30c;padding:0;width:500px;font-family:helvetica,sans-serif;margin:10px auto;}h1{font-weight:bold;color:#fff;font-size:14px;margin:0;padding:2px;text-align:center;background: #30c;}p{font-size:12px;margin:15px auto;width:75%;font-family:helvetica,sans-serif;text-align:left;}</style><title>504 DNS look up failed</title></head><body><div class="oc"><div class="ic"><div class="msg"><h1>504 DNS look up failed</h1><p>The webserver for http://localhost reported that an error occurred while trying to access the website. Please click <u><a href="javascript:history.back()">here</a></u> to return to the previous page.</p></div></div></div></body></html>
from /home/kempa/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/oauth2-0.9.3/lib/oauth2/client.rb:110:in`request'
from /home/kempa/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/oauth2-0.9.3/lib/oauth2/client.rb:135:in `get_token'
from /home/kempa/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/oauth2-0.9.3/lib/oauth2/strategy/auth_code.rb:29:in `get_token'
from (irb):21
from /home/kempa/.rbenv/versions/2.0.0-p451/bin/irb:12:in`<main>'
irb(main):022:0>
Thank you so much, I've been looking for doing this with has_many :through for so long. I'm trying to work this with autocomplete as well. It's surprising how so few results there are for "has many through autocomplete" in a search.
If you are going to use :histroy with friendly_id 5 you should consider the new change in slugs' regenrations. As version 5 the slugs are not updated on save unless you set them to nill first.
Updating a product
def update
@product.slug = nil
respond_to do |format|
if @product.update(product_params)
format.html { redirect_to @product, notice: 'Product was successfully updated.' }
format.json { render :show, status: :ok, location: @product }
else
format.html { render :edit }
format.json { render json: @product.errors, status: :unprocessable_entity }
end
end
end
Ryan, this screencast is very clear! I need to know if work with custom daemons: https://github.com/mirasrael/daemons-rails is the "best" solution for synchronize a db in an app that read/write external hardware memory (Programmable Logic Controller). It is about a long running task (maybe years) and it is desirable not to break the execution at all along - ..... Or can I consider other solution that fit in this types of problems?
Thank You...
if you have a lot of records you're going to use paginations, you're most likely going to have more records than you want to show on one page, therefore client side is useless.
Hi, I know, that this is a bit old question. Anyway for everyone who chalanged this problem, you can use .includes(:trackable), like with any other association.
Hey Wayne,
The "states.csv" and "countries.csv" data files are available in the github hosted "Source Code" under the "Show Notes" header:
https://github.com/railscasts/088-dynamic-select-menus-revised
By using the "db/seeds.rb" file you can migrate the data into any rails app.
bundle exec rake db:seeds
I hope this helps for future use.
I'm having trouble with the remove link in production. The fieldset remove works however it still triggers validation even though it is no longer visible on the screen. Am i missing a step?
gracias vsolari, lo que realmente me ayudó.
@Dee Koder: As of Rails 4, strong parameters are used instead of attr_accessible, read more here: a good answer on stackoverflow and the official ruby api on strong parameters
Thanks for this one more time amazing railscast !
Thx @shamgar that's work for me !
I ran into the same issue. Had to add the following strong params to the books_controller
Here is a comparison of different ways to get started making an AngularJS app including the example from this railscast
http://www.dancancro.com/comparison-of-angularjs-application-starters/
+1 for hstore
such impress. very thanks.
I think this is one of the very few resources out there that explains how rails is constructed. And it does so in the Ryan Bates's concise-yet-thorough style.
Having this primer will save so much time reading through the rails source code.
works fantastic with Kaminari AND Rails 4 with turbolinks. even after so many years. Thanks Ryan!
Tip: If you're using Kaminari, just add class="next_page" to the next page link in the Kaminari view
I must say thanks, 2 years later.
Wow. There is a lot of JS code in there.
Easily you can use just it:
$(document).ready(function() {
$('#example').dataTable();
});
Where #example is the ID of the table.
Remember to use dataTable as a class, and to read the documentantion:
https://datatables.net/
How would you implement chosen or select2 if your has_many through join table is not using the default id as a primary key? Is the syntax
author_ids
something rails handles automagically in the standard join table?Hi Ryan...This tutorial is really AWESOME..I'm just a newbie in rails but I never had a hard time understanding your tutorials...I have a question, Can I automate the rake task that index the search suggestions by event or by time?..Thanks in advance..
I didn't get it working with just Capistrano 3, because Capistrano doesn't want to use the sudo command a lot, and now recommends passwordless sudo. However, I made it work by provisioning with Sunzi. I made a how to video you can follow.
https://www.youtube.com/watch?v=S1iTmfnKS7Q
let(:comment) { FactoryGirl.create(:comment, user: user, commentable: question) }
subject { comment }
it { should respond_to(:commentable) }
Agree! It would be awesome! Been trying to setup Elasticsearch with the new Elasticsearch rails gem, but not finding enough/clear documentation on how to migrate from Tire. Railscasts are awesome!
I've done the nested form by referencing to http://railscasts.com/episodes/196-nested-model-form-revised?
I can fill three models' data in one form now,
But How to saving the form data and make it available to re-fill the form ?
The relations of the models is 'One survey has many questions,and one question has many answers,'
My roughly thinking is, save all the
survey_params
insurveys_controller.rb
Maybe I should create a new model
FormRecord
to keep all the form records,And when user comes to the form-page next time,
it'll selecting all the records he made,
and provide a checkbox and button to let him decide which form-data record he wants to fill the form.
But I have no idea what kind of the data structure I should have,
And How to fill the form via Javascript.
Is there any idea ? or reference ?
I followed the tutorial of
Nested Model Form (revised)
http://railscasts.com/episodes/196-nested-model-form-revised?view=commentsWhich is about how to create a survey with multiple models,
But I wonder how to make to survey cab be a real survey.
Let user can answer those questions and I can gather the user's feedback.
Please, help srinu4122. I have same question)
When I try to generate the access token in the irb console, I get "DNS lookup failed error". Does this have to do with some problem in my machine setup?
P.S.
My code is a little different:
First, I got carrierwave working as per 253-carrierwave-file-uploads
then..
@quindici can you please indicate what the error was, i am getting the same error. Thanks
Hey All,
Bootstrap 3 modifications:
And then
I hope this helps. I f'd around with this for hours install all new css, js files before it dawned on me to update the bootstrap css.
To Your Success!!! Mark
I had this issue. I think it had to do with a file I didn't have permissions to. Also do a search for "using rvm with god" if you are doing that.
Thank you so much! The issue was pg using different query syntax. good to know!
I'm still having an issue where the existing tags don't show up when I go to the edit page.
Would you also need a comma after 'facebook'? If not, why?
You can use:
Thank you so much, I've been looking for doing this with has_many :through for so long. I'm trying to work this with autocomplete as well. It's surprising how so few results there are for "has many through autocomplete" in a search.
Thank you for sharing
The reason why is explained here https://github.com/collectiveidea/delayed_job/issues/659.
Very useful, thanks. I also borrowed some code from this answer on Stack Overflow to make the updates lazier.
That's not a gem...
If you are going to use :histroy with friendly_id 5 you should consider the new change in slugs' regenrations. As version 5 the slugs are not updated on save unless you set them to nill first.
How can use the gem with ransack ?
At trying to build a search_form_for with the
owner_name_cont
, I keep getting the error:uninitialized constant PublicActivity::ORM::ActiveRecord::Activity::Owner
Thanks that worked for me too. (Rails 4.1.x)
Thanks!
See the NSScreencast episode below.
- Authentication with AFNetworking #41
- Retrying HTTP Requests #42
thx!
@vell http://activeadmin.info/docs/8-custom-actions.html
Nice done.
Ryan, this screencast is very clear! I need to know if work with custom daemons: https://github.com/mirasrael/daemons-rails is the "best" solution for synchronize a db in an app that read/write external hardware memory (Programmable Logic Controller). It is about a long running task (maybe years) and it is desirable not to break the execution at all along - ..... Or can I consider other solution that fit in this types of problems?
Thank You...
if you have a lot of records you're going to use paginations, you're most likely going to have more records than you want to show on one page, therefore client side is useless.
you mean reputation_for?
http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-all
Hi, I know, that this is a bit old question. Anyway for everyone who chalanged this problem, you can use
.includes(:trackable)
, like with any other association.Trying to implement this in a Rails 3 app. Anyone know how to translate the following route for Rails 3:
Thanks!
Where you able to fix this problem? If so, can you let me know what the bug is?
maybe this : https://github.com/prawnpdf/pdf-inspector