Simply updating the 'zurb-foundation' gem will not overwrite 'foundation_and_overrides.scss' or any of the other files in your assets folder.
However, if you then proceed to run rails generate foundation:install again, it will overwrite 'foundation_and_overrides.scss' (but not without prompting you for confirmation first). That generator will also modify 'application.css', 'application.js', and 'application.html.erb'.
About forms, to avoid the extra HTML that foundation requires, and also to have nice error rendering, I did a gem foundation_rails_helper that works with rails 3 and 4 and with foundation 3 and 4.
No way to let it work!
I really followed step by step the ASCIIcast (first part: client side) working on the Ryan's store-before app from github (master).
I used gem "jquery-datatables-rails", "~> 1.11.2" with ruby 1.9.3 and rails (3.2.1, 3.2.3) on windows.
I checked links to files in the html head page source, every link point to its file.
Now I don't know where to look for debugging again! Maybe there is a trick I missed?
I am trying to use Compass with Rails 4 rc2 but just recently I got an error when I generated a new migration and I suspect that Compass is one of the reasons why I get it:
"Don't know how to build task 'assets:precompile:primary'"
Would You be so kind to give me some pointers where I should look for the solution for this error?
I have been trying to understand this code for the past few hours $('#edit_task_<%= @task.id %>').appendTo('#complete_tasks');
From where do we get the "edit-task-" div ? Please help
This is a reply to a really old comment, but for anyone else that happens to run into this:
It's likely that you mistyped there. /usr/ instead of /user/ You're getting the permission error because you're trying to create a new directory from root (/) called user, instead of the existing path of /usr/local/var/
does any one had that problem after using the rubber:create ?
ruby-1.9.3-p429/gems/excon-0.23.0/lib/excon/middlewares/expects.rb:10:in `response_call': SecurityGroupLimitExceeded => You have exceeded the number of VPC security groups allowed per instance. (Fog::Compute::AWS::Error)
I agree, I would like to see an example with more than one nested form, and eventually adding an arbitrary number of nested forms via js using a form object
I'm still getting problems with rbenv just hanging on "Installing ruby-1.9.3-p429...", I've never had any problems before, or had to alter any SSH timeouts. Any ideas?
I can't believe how much pain this episode saved me this week. Using traditional methods was taking me down a twisted complex path that was dramatically simplified with a form object. This is right up there with presenters and service objects as the most significant changes in mindset for me.
Regarding the ranking and performance. Based on Postgres documentation you can store the results of the to_tsvector calls in a column, complete with weighting and then put your index on that specific column. Use a database trigger to keep that column up to date (containing as many search fields as you like and any other relevant data you'd like to throw in, author names, etc).
Calculating rank against that column will give you a relevance rank against everything you're searching for. I just implemented this approach on a huge site and the performance was lightning fast.
Nice Video.. I am having a problem with devise raising an error for the email can't be blank sign up. After removing the need for a email, I keep getting the error, ' ERROR: duplicate key value violates unique constraint "index_users_on_email" DETAIL: Key (email)=() already exists. : INSERT INTO "users" ("created_at", "provider", "uid", "updated_at", "username") VALUES ($1, $2, $3, $4, $5) RETURNING "id""
Thanks!!
+1 this. I like the idea of form objects but I also like having the validations defined on the models to help make sure things like Rake tasks obey the business rules. I might try leaving the validations defined on the model and then having the form object delegate the valid? and errors() methods to the model.
I'm running into a problem. This is a good One to one nested form, but we usually do one to many nested forms.
I've had trouble using this because I can't assign multiple things. How would I deal with features like "link_to_add" or "link_to_remove" and assigning multiple, say salaries, to a player? Unlike nested forms(with simple form) doing f.input :amount passes in ONE value for the :amount since it does not recognize that there are multiple salaries.
Caching the comments count only seems to work with a page reload. I am using ajax to add comments and updating the count in create.js.erb: $('#comments_count').html('<%= @article.comments.size %>'); ... when using the cached version the value is not yet updated at this point?
I think that in the best case, you would use a UserValidator class to perform general validations - this way it can be re-used by anything that needs to perform them.
Adding the ability to use a separate Validator class was a great change in Rails 3.. unfortunately I don't think it is used enough.
When implementing the disable/grey-out feature on the "Draw Winner" button, the button wasn't "greying out" for me due to missing CSS styling in the layout.css.scss file.
During the first Ember railscast, I had grabbed the CSS styling per the below link. That CSS file however lacks the necessary styling for the grey-out.
Here is a nice answer if your are doing controller or acceptance tests.
If you're like me and went with Rack::Test::Methods (see this post section 'Testing your API', some examples here as well), here's the solution (which was a pain to figure out ...) :
ruby
get '/api/v1/users.json', nil, 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Token.encode_credentials('THE-AWESOME-TOKEN')
Does anyone know how to get a background image working when following this methodology? I tried setting it in the controller and in the PDF class where the margins get set. The only thing I can get to work is adding an image the full size of the page, but if I try to repeat that using Prawn's repeat method, the image covers up all the content on the pages. I can't add the image manually one page at a time because the length of the content determines how many pages there are.
I've solved the problem, my problem was that the js.coffee file wasn't been included in the application.js file, that explains why the converted js worked directly on the application.js file, I had to added manually //= require ....js.coffee in the application.js file because i've removed the require_tree directive.
Maybe you have a lib conflict, I had to try with some adjustments to the Js code and It worked for me, also i had to put it in the application.js obviously there is other problem there, but at least is working
This is my code:
$('form').on ('click', '.add_fields',
function(event) {
time = new Date().getTime()
regexp = new RegExp($(this).data('id'), 'g')
$(this).before($(this).data('fields').replace(regexp, time))
event.preventDefault()}
)
Simply updating the 'zurb-foundation' gem will not overwrite 'foundation_and_overrides.scss' or any of the other files in your assets folder.
However, if you then proceed to run
rails generate foundation:install
again, it will overwrite 'foundation_and_overrides.scss' (but not without prompting you for confirmation first). That generator will also modify 'application.css', 'application.js', and 'application.html.erb'.Nice railscast about a framework I use everyday.
About forms, to avoid the extra HTML that foundation requires, and also to have nice error rendering, I did a gem foundation_rails_helper that works with rails 3 and 4 and with foundation 3 and 4.
It has also an helper for flash messages
HTH
Seb
If we're changing our "foundation_and_overrides.scss" file, what happens if we update zurb foundation? Will this file be overwritten?
Can you update this video again? The version of devise used in this video isn't easily compatible with Rails 4.
Thanks!
No way to let it work!
I really followed step by step the ASCIIcast (first part: client side) working on the Ryan's store-before app from github (master).
I used
gem "jquery-datatables-rails", "~> 1.11.2"
with ruby 1.9.3 and rails (3.2.1, 3.2.3) on windows.I checked links to files in the html head page source, every link point to its file.
Now I don't know where to look for debugging again!
Maybe there is a trick I missed?
Great video!
I am trying to use Compass with Rails 4 rc2 but just recently I got an error when I generated a new migration and I suspect that Compass is one of the reasons why I get it:
"Don't know how to build task 'assets:precompile:primary'"
Would You be so kind to give me some pointers where I should look for the solution for this error?
Best Wishes,
Matt
Never mind.. I just understood it.
I have been trying to understand this code for the past few hours
$('#edit_task_<%= @task.id %>').appendTo('#complete_tasks');
From where do we get the "edit-task-" div ? Please help
Did you ever get an answer to this?
This is a reply to a really old comment, but for anyone else that happens to run into this:
It's likely that you mistyped there. /usr/ instead of /user/ You're getting the permission error because you're trying to create a new directory from root (/) called user, instead of the existing path of /usr/local/var/
HTH
does any one had that problem after using the rubber:create ?
ruby-1.9.3-p429/gems/excon-0.23.0/lib/excon/middlewares/expects.rb:10:in `response_call': SecurityGroupLimitExceeded => You have exceeded the number of VPC security groups allowed per instance. (Fog::Compute::AWS::Error)
Thanks.
I agree, I would like to see an example with more than one nested form, and eventually adding an arbitrary number of nested forms via js using a form object
+1
I'm still getting problems with rbenv just hanging on "Installing ruby-1.9.3-p429...", I've never had any problems before, or had to alter any SSH timeouts. Any ideas?
Could you share the code? Original isn't available anymore.
Hi, can you share this again, link isn't available.
I can't believe how much pain this episode saved me this week. Using traditional methods was taking me down a twisted complex path that was dramatically simplified with a form object. This is right up there with presenters and service objects as the most significant changes in mindset for me.
Regarding the ranking and performance. Based on Postgres documentation you can store the results of the to_tsvector calls in a column, complete with weighting and then put your index on that specific column. Use a database trigger to keep that column up to date (containing as many search fields as you like and any other relevant data you'd like to throw in, author names, etc).
Calculating rank against that column will give you a relevance rank against everything you're searching for. I just implemented this approach on a huge site and the performance was lightning fast.
http://www.postgresql.org/docs/8.3/static/textsearch-features.html
See the "triggers and automatic updates" section.
Nice Video.. I am having a problem with devise raising an error for the email can't be blank sign up. After removing the need for a email, I keep getting the error, ' ERROR: duplicate key value violates unique constraint "index_users_on_email" DETAIL: Key (email)=() already exists. : INSERT INTO "users" ("created_at", "provider", "uid", "updated_at", "username") VALUES ($1, $2, $3, $4, $5) RETURNING "id""
Thanks!!
This gem https://github.com/evrone/factory_girl-seeds helps to minimize total spec run time by preloading records for factory_girl and then use them in spec.
submit_to_remote
no longer exist in Rails 3. Just use asubmit
and do as described in the video.Im using CentOS server through ssh, and ran:
sudo gem install passenger
rvmsudo passenger-install-apache2-module
Passenger stops installing on:
Command failed with status (): [g++ -Iext -Iext/common -Iext/libev -D_REENTRANT -I/usr/local/include -DHAS_TR1_UNORDERED_MAP -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -ggdb -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -o libout/common/libpassenger_common/ApplicationPool2/Implementation.o -c ext/common/ApplicationPool2/Implementation.cpp]
even after waiting for an hour no success, any idea what went wrong?
Haha, this comment really helps me. Thank you
+1 this is a bummer
It'll be something like:
CSV.parse("text you are processing", column separator, row separator)
I had the same problem with heroku, have you found a solution?
+1 this. I like the idea of form objects but I also like having the validations defined on the models to help make sure things like Rake tasks obey the business rules. I might try leaving the validations defined on the model and then having the form object delegate the valid? and errors() methods to the model.
I'm running into a problem. This is a good One to one nested form, but we usually do one to many nested forms.
I've had trouble using this because I can't assign multiple things. How would I deal with features like "link_to_add" or "link_to_remove" and assigning multiple, say salaries, to a player? Unlike nested forms(with simple form) doing f.input :amount passes in ONE value for the :amount since it does not recognize that there are multiple salaries.
she is rough around the edges; but some of you might be interested in
https://github.com/hookercookerman/form_model
Another great cast.
Caching the comments count only seems to work with a page reload. I am using ajax to add comments and updating the count in create.js.erb:
$('#comments_count').html('<%= @article.comments.size %>');
... when using the cached version the value is not yet updated at this point?I also ran into this. Initially I saw nothing on screen. Changed:
<% calendar do |date| %>
to
<%= calendar do |date| %>
All is well!
I think that in the best case, you would use a UserValidator class to perform general validations - this way it can be re-used by anything that needs to perform them.
Adding the ability to use a separate Validator class was a great change in Rails 3.. unfortunately I don't think it is used enough.
When implementing the disable/grey-out feature on the "Draw Winner" button, the button wasn't "greying out" for me due to missing CSS styling in the layout.css.scss file.
During the first Ember railscast, I had grabbed the CSS styling per the below link. That CSS file however lacks the necessary styling for the grey-out.
Ember railscast #1 CSS
https://github.com/railscasts/408-ember-part-1/blob/master/raffler-after/app/assets/stylesheets/layout.css.scss
Ember railscast #2 CSS
https://github.com/railscasts/410-ember-part-2/blob/master/raffler-before/app/assets/stylesheets/layout.css.scss
Here is a nice answer if your are doing controller or acceptance tests.
If you're like me and went with Rack::Test::Methods (see this post section 'Testing your API', some examples here as well), here's the solution (which was a pain to figure out ...) :
And here is a little helper to keep things DRY :
How do I setup multiple environments in the .ENV file?
There is Rails Email Preview, a gem I wrote for previewing and editing emails, with i18n and premailer support!
This doesn't work with airbrake :s
Do anyone know a solution to this?
Does anyone know how to get a background image working when following this methodology? I tried setting it in the controller and in the PDF class where the margins get set. The only thing I can get to work is adding an image the full size of the page, but if I try to repeat that using Prawn's repeat method, the image covers up all the content on the pages. I can't add the image manually one page at a time because the length of the content determines how many pages there are.
I think the proper way to prepare the fields HTML is as follows:
and then define
escape_html_attribute
as follows:This prevents the
&
in

from being escaped.Anyone know how to solve encoding issues with xls files generated by the simple "html" definition of a table described in the cast?
I have problems on import in LibreOffice, MS Office with special characters and umlauts (§, ö etc.).
I didn't see this episode, but i'll bet that https://github.com/railsware/sht_rails and https://github.com/railsware/smt_rails much interesting solutions.
and how much would that cost them to operate that many memcached servers
What did you do to get your assets to compile correctly? I think I am having the same issue.
I've solved the problem, my problem was that the js.coffee file wasn't been included in the application.js file, that explains why the converted js worked directly on the application.js file, I had to added manually //= require ....js.coffee in the application.js file because i've removed the require_tree directive.
+1 to Refactoring videos :)
+1
Maybe you have a lib conflict, I had to try with some adjustments to the Js code and It worked for me, also i had to put it in the application.js obviously there is other problem there, but at least is working
This is my code:
$('form').on ('click', '.add_fields',
function(event) {
time = new Date().getTime()
regexp = new RegExp($(this).data('id'), 'g')
$(this).before($(this).data('fields').replace(regexp, time))
event.preventDefault()}
)
Sometimes I feel confusing when to use Service Object vs Form Object?
And it's good to do it that way, otherwise you start running into premature optimization.
I figured this out if anyone else runs into this question. The key is using CarrierWaveDirect matchers:
http://stackoverflow.com/questions/16993366/testing-carrierwave-file-uploads-to-s3-with-capybara-and-rspec