codenapse-team: I'm sorry if this sounds too obvious, but the code you posted still had the comment characters ('//') on each line. If you'd like to change the color, the line should look like this: $topbar-bg-color: #9c1;
Thanks a lot, this was very helpful. Just got the last part with arrows to work, looks great! The only problem I had is that when I write in css a .current .asc{} or th .current .asc{} it doesn't work, I used th .asc{} and th .desc{} which worked. (Not sure why it has problem stacking two classes.)
Also for images url is: url(/assets/arrow_up.png); So basically had to replace "images" with "assets" and it works.
In Rails 4 (and 4.1) you still need to use strong parameters and allow the properties in the controller. If you aren't at all worried about security you can just call params.permit! and that should work out just fine for you.
HI i am using solr search. in which i want to give less priorty for some words. say if i search for dance lessons.it should get more results for dance in top and then lessons..etc.like wise dance lessons in music means dance and music in top of the result and then lessons
You may be tempted to use 1 and 0 since those are the values used in the database for a TINYINT, but Rails will not show the correct default option for the select menu if you use integers. So make sure you use booleans!
when i try to change the color of the top bar in foundation_and_overrides.scss the color of the bar in the app doesn't change , i'ved tried to stop the rails server and started it again but the color doesn't change
ruby 2.1.0
rails 4.0.3
the code that i'ved change
// $topbar-bg-color: #000;
// $topbar-bg: $topbar-bg-color;
Thanks a lot, Rayan. You do great job with RailsCasts. This website is the most useful source about rails.
Anyway, function load_and_authorize_resource not works properly with Rails4. There is ForbiddenAttributesError generated sometimes. To solve it we should type this code into our applicationController
ruby
before_filter doreturnif !(request.post? or request.patch? or request.put?)
resource = controller_path.singularize.gsub('/', '_').to_sym
method = "#{resource}_params"
params[resource] &&= send(method) if respond_to?(method, true)
end
godaddy certs seems so cheap and nasty tho. whenever i see a site with a cert from them i know they are cheap. i myself use comodo ones as to me they seem more of a trusted brand. they do a good deal of internet security products these days, and the good thing is you can get them for cheap their SSLs.
i use ssltrustthese days to get them as they are a reseller of comodo so you get them a LOT cheaper but you can still use the comodo phone support and online support if you need to.
godaddy certs seems so cheap and nasty tho. whenever i see a site with a cert from them i know they are cheap. i myself use comodo ones as to me they seem more of a trusted brand. they do a good deal of internet security products these days, and the good thing is you can get them for cheap their SSLs.
i use ssltrustthese days to get them as they are a reseller of comodo so you get them a LOT cheaper but you can still use the comodo phone support and online support if you need to.
I have simple project, updated to Rails 4, and the current version of all the testing gems he used. (It also includes spork.) The readme includes some vague instructions that will make more sense if you follow along to this railscast. With the railscast and my code, you should be able to get testing working.
Please any idea of use delayed_jobs for multitenant app with Postgresql schemas.
Each task puts in current schema to the moment. But DJ getting tasks from public schema only.
Thank you for you railscasts. I was trying to implement Paypal Payments Standard. There was some issues about that and i hope this would help someone like me.
In model i had to change the cmd: to '_xclick', while in view it still '_s-xlick'. I deleted the section with values.merge!, because it didn't work and i just added amount: and item_name: right to values hash like that:
I'm running into a problem with my form, which is shared across new and edit actions. In the case of new, I need the parent and child objects passed into the form_for to generate the right route. In the case of edit, I need only the child object. I found a work-around for this problem googling around, but I'm surprised it is an issue that requires a work-around? Maybe I'm missing something?
I'm not getting any output into the log file. How can I get it to write to file? Not sure what it's supposed to write to log in this tutorial (?), but it's not writing anything for me. Command system "rake reload --trace >> #{Rails.root}/log/rake.log &"
Also looking for an answer as to how I can allow for multiple uploads attached to one object (nested attributes). Although its been asked about 20 times already...I'll ask it again, has anyone found a solution?
Hi Guys. Followed the tutorial above and getting an error with the stripe_token not being passed. Am getting the following error
Parameters: {"utf8"=>"V", "authenticity_token"=>"JLYuag3ojhYttMw3YOLBD5+J7NUly
zM61YFgRhKkc3M=", "subscription"=>{"stripe_card_token"=>"", "plan_id"=>"8", "ema
il"=>"test@mail.com"}, "commit"=>"Subscribe"}
←[1m←[35mPlan Load (0.0ms)←[0m SELECT "plans".* FROM "plans" WHERE "plans"."i
d" = ? ORDER BY "plans"."id" ASC LIMIT 1 [["id", 8]]
Stripe error while creating customer: You passed an empty string for 'card'. We
assume empty values are an attempt to unset a parameter; however 'card' cannot b
e unset. You should remove 'card' from your request or supply a non-empty value
subscription.rb
classSubscription < ActiveRecord::Base
belongs_to :plan
validates_presence_of :plan_id
validates_presence_of :email
attr_accessor :stripe_card_tokendefsave_with_paymentif valid?
customer = Stripe::Customer.create(description: email, plan:self.plan.name, card: stripe_card_token)
self.stripe_customer_token = customer.id
save!
endrescueStripe::InvalidRequestError => e
logger.error "Stripe error while creating customer: #{e.message}"
errors.add :base, "There was a problem with your credit card."falseendend
on the up side, while I was tearing out my hair and trawling the internet for knowledgez, I learned more about bundler and gemfile.lock and cap deploy:rollback and rails console (bundle exec rails console -e production
)
You can do array of hashes. But not hash of arrays.
It doesn't work dude. When I open my terminal, I get this errors .
Unknown ruby interpreter version (do not know how to handle): textmate.
Could not load ruby textmate.
{18:20}[1.9.3]~ ➭
And in my .zshrc file, I have add this line of code
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
Its doesn't change any more.
I have try this but still I am getting same error.
Unknown ruby interpreter version (do not know how to handle): textmate.
Could not load ruby textmate.
{18:20}[1.9.3]~ ➭
And in my .zshrc file, I have add this line of code
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
I'm using rails 4 & i'm getting this error
"Couldn't find HomeworkType without an ID"
showing as 404 error while dragging & dropping.
Please help me guys
undefined method `sortable_element'
I'm getting this error in Rails-4.
This method is deprecated in rails-4 then how did you worked with it ?
undefined method `sortable_element'
I'm getting this error in Rails-4.
This method is deprecated in rails-4 then how did you worked with it ?
Did you ever figure how to delete the reciprocal relationship? Seemed like an obvious omission in this otherwise excellent episode.
Is Activerecord query supports json data type of PG ?
Same. Tomas do you find the solution to this?
codenapse-team: I'm sorry if this sounds too obvious, but the code you posted still had the comment characters ('//') on each line. If you'd like to change the color, the line should look like this:
$topbar-bg-color: #9c1;
Thanks a lot, this was very helpful. Just got the last part with arrows to work, looks great! The only problem I had is that when I write in css a .current .asc{} or th .current .asc{} it doesn't work, I used th .asc{} and th .desc{} which worked. (Not sure why it has problem stacking two classes.)
Also for images url is: url(/assets/arrow_up.png); So basically had to replace "images" with "assets" and it works.
how can I use the client side validation with nested_
form_for
i am using client side side validation gem
Hey Gant,
In Rails 4 (and 4.1) you still need to use strong parameters and allow the properties in the controller. If you aren't at all worried about security you can just call params.permit! and that should work out just fine for you.
Railscast #287 covers Presenters.
http://railscasts.com/episodes/287-presenters-from-scratch
thanks chreyes you saved my day.
I would not mind seeing a bit more how you got this working. Looks interesting
+1
Awesome tutorial!
I did
def update
respond_with Entry.find(params[:id]).update_attributes(entry_params)
end
private
def entry_params
params.require(:entry).permit(:name, :winner)
end
HI i am using solr search. in which i want to give less priorty for some words. say if i search for dance lessons.it should get more results for dance in top and then lessons..etc.like wise dance lessons in music means dance and music in top of the result and then lessons
I just want to point out that you should use
true
andfalse
for any boolean fields that you have. As seen in the ASCIIcast:form.select :discontinued, [["Yes", true], ["No", false]]
You may be tempted to use 1 and 0 since those are the values used in the database for a TINYINT, but Rails will not show the correct default option for the select menu if you use integers. So make sure you use booleans!
Hi I am getting this error. What i want to change
undefined method `sub' for #Array:0x007fcdcd27d678
if crop_command
crop_command + super.sub(/ -crop \S+/, '')
else
help me
Thanks in advance
that's really good.
Had the same Problem. Try http://malot.fr/bootstrap-datetimepicker/index.php.
It can be easily integrated with the following gem:
https://github.com/smalot/bootstrap-datetimepicker.
Worked well for me.
(If this info is outdated for you, it might help someone else.)
Are
application_controller.rb
andsessions_controller.rb
in the root?Just checking since it doesn't specify
app/controllers/*
in the file name.when i try to change the color of the top bar in foundation_and_overrides.scss the color of the bar in the app doesn't change , i'ved tried to stop the rails server and started it again but the color doesn't change
ruby 2.1.0
rails 4.0.3
the code that i'ved change
// $topbar-bg-color: #000;
// $topbar-bg: $topbar-bg-color;
Hello Guys I have just completed this tutorial in Ruby 2 and Rails 4, If anyone needs help email me at
steve.pdp@gmail.com
Thank you Anna! Foreman (w ruby 2.0 and rails 3.2.14) was not appreciating the non-hashrocket syntax.
Thanks a lot, Rayan. You do great job with RailsCasts. This website is the most useful source about rails.
Anyway, function
load_and_authorize_resource
not works properly with Rails4. There isForbiddenAttributesError
generated sometimes. To solve it we should type this code into our applicationControllergodaddy certs seems so cheap and nasty tho. whenever i see a site with a cert from them i know they are cheap. i myself use comodo ones as to me they seem more of a trusted brand. they do a good deal of internet security products these days, and the good thing is you can get them for cheap their SSLs.
i use ssltrustthese days to get them as they are a reseller of comodo so you get them a LOT cheaper but you can still use the comodo phone support and online support if you need to.
godaddy certs seems so cheap and nasty tho. whenever i see a site with a cert from them i know they are cheap. i myself use comodo ones as to me they seem more of a trusted brand. they do a good deal of internet security products these days, and the good thing is you can get them for cheap their SSLs.
i use ssltrustthese days to get them as they are a reseller of comodo so you get them a LOT cheaper but you can still use the comodo phone support and online support if you need to.
To Tobias point:
For whatever reason the launch! method didn't work for me. I used the syntax I found at https://github.com/celluloid/celluloid/wiki/Basic-usage: r.async.launch
When I tried to use r.launch! I got:
NoMethodError: undefined method `launch!' for #
I have simple project, updated to Rails 4, and the current version of all the testing gems he used. (It also includes spork.) The readme includes some vague instructions that will make more sense if you follow along to this railscast. With the railscast and my code, you should be able to get testing working.
https://github.com/crslade/todoAuthW14
Please any idea of use delayed_jobs for multitenant app with Postgresql schemas.
Each task puts in current schema to the moment. But DJ getting tasks from public schema only.
You can try use uniq name of uploaded files-
Ryan, you know the joke. google -> stackoverflow -> railscasts -> gem
Thank you :-)
Thank you for you railscasts. I was trying to implement Paypal Payments Standard. There was some issues about that and i hope this would help someone like me.
In model i had to change the cmd: to '_xclick', while in view it still '_s-xlick'. I deleted the section with values.merge!, because it didn't work and i just added amount: and item_name: right to values hash like that:
values = { business: xxx@yy.com',
cmd: '_xclick',
amount: total_price,
item_name: "here is your description",
upload: 1,
:return => return_url,
invoice: id,
notify_url: notify_url,
:currency_code => 'USD',
cert_id: "xxxxxxxxxxxxx"
}
Note that you have to do something with invoice, because there will not be 2 transactions with the same invoice. Hope it helps!
Hi. Im using Rails 4 and getting errors. I have followed episode 241 and the twitter integration works perfect. In this episode Im getting:
No route matches [POST] "/auth/identity/callback"
Is it because Im using Rails 4?
Martin, I want to do something similar. Did you find a solution?
I'm running into a problem with my form, which is shared across new and edit actions. In the case of new, I need the parent and child objects passed into the form_for to generate the right route. In the case of edit, I need only the child object. I found a work-around for this problem googling around, but I'm surprised it is an issue that requires a work-around? Maybe I'm missing something?
I'm not getting any output into the log file. How can I get it to write to file? Not sure what it's supposed to write to log in this tutorial (?), but it's not writing anything for me. Command system "rake reload --trace >> #{Rails.root}/log/rake.log &"
Also looking for an answer as to how I can allow for multiple uploads attached to one object (nested attributes). Although its been asked about 20 times already...I'll ask it again, has anyone found a solution?
Hi Guys. Followed the tutorial above and getting an error with the stripe_token not being passed. Am getting the following error
```jQuery ->
Stripe.setPublishableKey($('meta[name="stripe-key"]').attr('content'))
subscription.setupForm()
subscription =
setupForm: ->
$('#new_subscription').submit ->
$('input[type=submit]').attr('disabled', true)
subscription.processCard()
false
processCard: ->
card =
{number: $('#card_number').val(),
cvc: $('#card_code').val(),
expMonth: $('#card_month').val(),
expYear: $('#card_year').val()}
Stripe.createToken(card, subscription.handleStripeResponse)
handleStripeResponse: (status, response) ->
if status == 200
$('#subscription_stripe_card_token').val(response.id)
$('#new_subscription')[0].submit()
else
$('#stripe_error').text(response.error.message)
$('input[type=submit]').attr('disabled', false)```
Any help would be greatly appreciated
This stumped me as well and caused me to burn several days. In the end it was a simple restart of unicorn that fixed it
/etc/init.d/unicorn_my_app stop
/etc/init.d/unicorn_my_app start
Which i got from this ref
http://stackoverflow.com/questions/10756626/initializer-or-gem-not-loaded-with-unicorn-causing-500-internal-server-error
on the up side, while I was tearing out my hair and trawling the internet for knowledgez, I learned more about bundler and gemfile.lock and cap deploy:rollback and rails console (bundle exec rails console -e production
)
so all around not a loss.
Great solution, works for me .
The problem of create.js is over :)
Really USEFULL Thanks Ryan
Is there in ActionController::Live some way to generate private secured channels?
Excellent ScreenCast .
Thanks Ryan for all the hard work you put out there.
Hope to hear from you soon.
Nice episode
How did you do it to not get a hang when rendering the pdf? Are the application.css styles applied to your pdf?
I've been stuck in this a long time.