Does anyone have any suggestions on how I would start content always from next page when it's breaking between pages.
Example - I have list of photos which i am exporting to pdf.
While listing some photos are cutting in two parts first is coming in one page and remaining coming on other page so how we start photo which is breaking in two part should always display from starting of the page
How would you do this if your model is not ActiveRecord based? Since I'm not using ActiveRecord, I don't have access to the accepts_nested_attributes_for method.
Yeah, your playbacks always cut off the last couple of seconds, for me. If nothing else pad it with music that fades out. This way, we will at least hear everything you say and know we've reached the end.
So, I've been struggling to figure out what is failing.. Everything installs and setups up fine...code is deployed to the correct location. Both unicorn and nginx are started, but when I hit the site all I get is the Welcome to nginx screen. I even doubled checked that the default site for nginx was gone...any ideas where I could look to figure out what is happening?
note that if you precompile your assets in dev, you'll need to mv or rm /public/assets if you want any future changes to a .css.sass file to show up. At least that is the case here :)
In fact, a ||= "something" is equivalent to a = a || "something"
What does this mean? a = a || "something" -> left operand in a || "something" isn't defined, evaluates to nil, which is false, then right operand needs to be evaluated as well, so assigning a value.
That's an idiom that came from C language. Try that in irb and you see there's no error at all.
Hi Ryan - I wanted to clarify how the object is used in can?. For example...say you have "@users.each do |u|"...with can? inside the loop. I notice many examples freely use either "User" or "u" as the object in can?. Is there a difference? It seems like calling the model as the object "can? :edit, User" would signify "current_user can edit users" whereas "can? :edit, u" would signify "current_user can edit this user"...since u is specific to a record and User is general to the model. Maybe Im putting too much thought in to this. Just wanted to clarify.
Sure I have used it to send email, and it works great.
It was pretty simple. The send_confirmation looks up the user, and then gets their email address and whatever other information needed.
QC.enqueue("UserMailer.send_confirmation", @user.id)
You may want to enable delivery errors in your development.rb config file. Maybe there's a failure you are not seeing.
config.action_mailer.raise_delivery_errors = true
namespace :imagemagickdo
desc "Install the latest release of ImageMagick and the MagickWand Dev Library"
task :install, roles::appdo
run "#{sudo} apt-get -y update"
run "#{sudo} apt-get -y install imagemagick libmagickwand-dev"end
after "deploy:install", "imagemagick:install"end
which isn't firing datepicker as expected. Does the multi-word model have an effect on jQuery? I've used datepicker before without issue, but all models have been of one word.
Sometimes after trying to edit a field, best in place rejects the edit. When I try clicking on the same field to edit again, it doesn't let me click until I refresh. Any idea why this happens?
In these cases, no error message flashes. In the cases where the error message does flash, I can re-enter the invalid data as normal. So the two seem to co-occur.
Although you shouldn't need the id => false in the create_table declaration. The example given from Matt Bauer from what I can see is using the id as the bigint column whereas here we have replaced it with tweet_id. I have tested this myself and I can confirm it works.
i would like to see how u insert a datepicker when u have to change the format to the user, but to save on the database u have to change the format back to rails.
its easy to change the format from / to - only, i really got trapped when i need to format 2012-06-31 to 31/06/2012 to the user and save correctly to the database... thats what i really need to know
Is the asset pipeline available if you use the defaults from rails-api? I want to use rails for backend REST but ember.js for the frontend and include it as part of my js assets.
I am using ruby 1.9.3p194 and rails 3.2.5
when i do @authors = Author.all It works fine by outputing all name from my database.
But @authors = Author.where("name like ?", "%#{params[:q]}%")
is not working. I am using Mongodb.
What could be the solution?
If you are using a Debian distro like Ubuntu, you can do what is suggested in this StackOverflow answer as it worked for me.
switched the secret access key and access key.... works
Anybody knows what this error is about?
happens on
cap rubber:create_staging
is this supposed to be filled in
fog:
credentials:
provider: rackspace
rackspace_api_key: 'XXX'
rackspace_username: 'YYY'
image_type: 123
image_id: 123
Hi Scott.
I need to install Libsndfile as a binary instance... How is that done, do you know?
I second that. We got the backbone.js but I'd like to see something that isn't quite so heavy.
Stuart, thanks for the explanation of why having
require_tree .
earlier in the manifest causes this issue. It wasn't obvious to me.Does this setup with pow and nginx interfere with mongoid?
I get a routing error with "uninitialized constant Model::Mongoid" when I use a Mongoid model.
The only thing I can think of is that the proxy some how gets in the way.
Has any one else experienced this?
If you use S3 as storage
Thanks Ryan for this episode. Yet to watch this. I would like to know whether this work with Ruby1.8.7?
Does anyone have any suggestions on how I would start content always from next page when it's breaking between pages.
Example - I have list of photos which i am exporting to pdf.
While listing some photos are cutting in two parts first is coming in one page and remaining coming on other page so how we start photo which is breaking in two part should always display from starting of the page
This helped me too, thanks!
How would you do this if your model is not ActiveRecord based? Since I'm not using ActiveRecord, I don't have access to the accepts_nested_attributes_for method.
seperate before/after:
+1
A common misconception is that
a ||= b
is equivalent toa = a || b
, but it actually behaves likea || a = b
.Yeah, your playbacks always cut off the last couple of seconds, for me. If nothing else pad it with music that fades out. This way, we will at least hear everything you say and know we've reached the end.
Just add
y
...Nice idea. It should be in rails like built-in validation. Thank's Ryan.
+1... Saved my day!
You saved my day!
So, I've been struggling to figure out what is failing.. Everything installs and setups up fine...code is deployed to the correct location. Both unicorn and nginx are started, but when I hit the site all I get is the Welcome to nginx screen. I even doubled checked that the default site for nginx was gone...any ideas where I could look to figure out what is happening?
Great episode. Transition went smoothly
+1 I have the same issue
Thanks, really nice gem
+1
note that if you precompile your assets in dev, you'll need to mv or rm /public/assets if you want any future changes to a .css.sass file to show up. At least that is the case here :)
Using Foreman with Upstart is the way to go these days. This is a decent post on it.
In fact,
a ||= "something"
is equivalent toa = a || "something"
What does this mean?
a = a || "something"
-> left operand ina || "something"
isn't defined, evaluates to nil, which is false, then right operand needs to be evaluated as well, so assigning a value.That's an idiom that came from C language. Try that in irb and you see there's no error at all.
Hi Ryan - I wanted to clarify how the object is used in can?. For example...say you have "@users.each do |u|"...with can? inside the loop. I notice many examples freely use either "User" or "u" as the object in can?. Is there a difference? It seems like calling the model as the object "can? :edit, User" would signify "current_user can edit users" whereas "can? :edit, u" would signify "current_user can edit this user"...since u is specific to a record and User is general to the model. Maybe Im putting too much thought in to this. Just wanted to clarify.
THANKS FOR CREATING CANCAN!
Thanks, I had the same issue, and that was it - recompiling assets helped!
Sure I have used it to send email, and it works great.
It was pretty simple. The send_confirmation looks up the user, and then gets their email address and whatever other information needed.
QC.enqueue("UserMailer.send_confirmation", @user.id)
You may want to enable delivery errors in your development.rb config file. Maybe there's a failure you are not seeing.
config.action_mailer.raise_delivery_errors = true
This worked for me on Ubuntu 12.04:
Thank you, I was wondering why the group didn't exist.
I am running into the same issue and can't seem to figure out how to fix it, have you been able to figure it out yet?
I needed to validate permission of a polymorphic association with CanCan.
Hope this helps someone:
Better explanation in this Gist.
i get this on the very next page after the user signs up using fb using the oauth fb video tutorial here (and devise oauth).
this error is triggered by
= current_user.facebook.get_object("me").to_yaml
anybody dealt with this?
OAuthException: Error validating access token: Session has expired at unix time 1345496400. The current unix time is 1345499103.
I get
ArgumentError: wrong number of arguments (1 for 0)
for this call:first = date.beginning_of_month.beginning_of_week(START_DAY)
If I try it in the console it also gives me the same error.
Date.today.beginning_of_month.beginning_of_week(:sunday)
This is weird. I have a model called calendar_event. So, in the .coffee file I have
jQuery ->
$('#calendar_event_starts_at').datepicker
dateFormat: 'yy-mm-dd'
which isn't firing datepicker as expected. Does the multi-word model have an effect on jQuery? I've used datepicker before without issue, but all models have been of one word.
Thanks,
Steve
Sounds like this could save some requests esp. when finding an address.
Thank you.
Sometimes after trying to edit a field, best in place rejects the edit. When I try clicking on the same field to edit again, it doesn't let me click until I refresh. Any idea why this happens?
In these cases, no error message flashes. In the cases where the error message does flash, I can re-enter the invalid data as normal. So the two seem to co-occur.
Any help is greatly appreciated!
that was nice :D
Thanks for posting, very useful.
Although you shouldn't need the id => false in the create_table declaration. The example given from Matt Bauer from what I can see is using the id as the bigint column whereas here we have replaced it with tweet_id. I have tested this myself and I can confirm it works.
i would like to see how u insert a datepicker when u have to change the format to the user, but to save on the database u have to change the format back to rails.
its easy to change the format from / to - only, i really got trapped when i need to format 2012-06-31 to 31/06/2012 to the user and save correctly to the database... thats what i really need to know
Thank you for answering yourself as this is just what I was looking for :)
You may get this error in Rails 3.2
N+1 Query detected
Country => [:states]
Add to your finder: :include => [:states]
N+1 Query method call stack
Add includes to Country as below
Same stuff as
first one works well under ruby 1.9
Is the asset pipeline available if you use the defaults from rails-api? I want to use rails for backend REST but ember.js for the frontend and include it as part of my js assets.
I am using ruby 1.9.3p194 and rails 3.2.5
when i do @authors = Author.all It works fine by outputing all name from my database.
But @authors = Author.where("name like ?", "%#{params[:q]}%")
is not working. I am using Mongodb.
What could be the solution?
nice piece, also for the neat metaprogramming example!
NB: playback cuts off a little, missing the last couple of seconds.