Does anyone have a working example with Bootstrap and Ajax on Github that I could look at? I think I'm close to getting this to work, but the datatable isn't fetching the json data for some reason. I suspect it's a problem with my javascript, but I can't find the problem.
I initialize my datatables in assets/javascripts/table.js like this:
If anyone is trying to figure out why their Rails application being served by Passenger just isn't streaming data, you should know that Passenger 3.0.11 introduced a new setting that breaks streaming by default.
Has anyone here used Select2 without any problems? It looks pretty awesome, but on github it currently has 76 total downloads, which is discouraging. I just wonder how supported it will be in the future if I were to implement it in an app.
I wanted to check with the community is this is still working for everybody.
I am having issues when using unicorn with a Capistrano deployment. From what I have been able to understand Capistrano uses a scheme in wich every release is deployed inside the releases directory under a unique name and if the transaction was successful, creates a symlink named current that will point to that release.
So I end up with a deployment directory such as:
/home/deployer/apps/sample_app/current
Then when I try to start unicorn from the binstubs directory all the unicorn methods look for things in the following path, particularly in the configurator.rb module:
/home/deployer/apps/sample_app
I haven't been able to fully understand how unicorn sets the working_directory from here:
Rubber generates config into your project. By default we set up HAProxy, but you're welcome to delete that and reconfigure the web server ports. I do that currently: I have apache listen on 80 & 443 and use mod_cluster to some TorqueBox servers.
If you want to build an API, you really don't need the whole thing called Rails. But before stripping down Rails, think what Rails is. Rails is just a kind of collection of some ruby gems.
So it might be easier to use a more lightweight framework like padrino and put inside what you need.
I switched to us-east-1 and changed AMI accordingly. Guess what, It worked on the first attempt. I tried the eu-west-1 numerous times but always getting stuck at the above. Strange! The only explanation I can think of is that the AMIs aren't identical.
I used:
ami-a29943cb for us-east-1
ami-e1e8d395 for eu-west-1
In the EU setup all servers ended up in eu-west-1a (as there are 1a, 1b, 1c) so that cannot be the issue.
Hi I have been trying to use the t1.micro image_type on eu-west-1, using the ami-e1e8d395. I can create and bootstrap and even deploy app role servers and db role servers. But unable to even bootstrap the web role server.
It gets stuck while running ./script/rubber config is being run. If I ssh to the server the rvm process is a zombie. If I kill it and run locally I get the same result. Below is what I get when running:
FILTER=web01 cap rubber:booystrap
i'm planning to use active admin for my website. For some forms, i want to initialize its field assigned with its user information.
For example I have 3 tables, admin_users, agents, packets, admin_users has_one agents, and agents has_many. In Packet new form, i want to assign agent_id field with current agent.
I've been trying to assign before_create in packet model but none is work. So how can I assign value before showing create page?
I think it was built for an older version of bootstrap, I had to set the appropriate widths to 200px for it to look just right. My issues could also be simple_form related, so I'm not sure.
When using m1.small things work great. But when using t1.micro the web role server fails miserably on bootstrap. Hangs while doing rubber config. Cant't go beyond the transforming collectd.conf. Any ideas?
Does anyone know how to make Chosen behave with existing styles? It works in my simple_form based forms but it is completely out of whack with the styling of other elements? My form elements have the labels at the top with the input boxes/dropdowns in the bottom. Chosen forces the labels to be on left hand side. Also it is misaligned.
Any pointers on how to make it blend with the rest of the form?
When using a gem like Boostrap for example, how can we include the files provided by the gem to precompile. So far the only way I've been able to make it work is to copy the files needed from the gem to the Rails app. But I feel there must be way to include gem related files to the assets pipeline.
I'm having trouble with a slightly more advanced version of this where I'm trying to use connected sortable lists and sort things between lists. I have a few models (Page, Row, Column, Block) and want to let users drag blocks between columns. The tricky part that I can't figure out is the best way to delete a column/row if it no longer has blocks after sorting. Can anyone help? I posted the question in more detail on stackoverflow here http://stackoverflow.com/questions/10500994/rails-sort-connected-lists-and-delete-empty-parent
Please hop on the rubber user list [1] and I'll try to help you out there. Sorry, I misread what you typed earlier as us-west-1. The eu-west-1 AMI is ami-1de8d369 (again, taken from http://alestic.com/).
Hello, I get this error when trying to create the author_token field using simple_form:
wrong number of arguments (0 for 1)
The funny thing is I get that error even if I do this:
rails
= f.input :author_tokens, :data => '1,2'
Seems that no matter what I put into :data => I keep getting this error. I even get it if I don't use simple_form but the regular form_for tag. I should mention that I'm using Ruby 1.8.7 if that makes any difference.
hey, i accidentially broke your site. Also your tagging system is stuck at "please enter 1 more characters"[sic]
Never mind, I had the javascript in two different files...Ugh!
Does anyone have a working example with Bootstrap and Ajax on Github that I could look at? I think I'm close to getting this to work, but the datatable isn't fetching the json data for some reason. I suspect it's a problem with my javascript, but I can't find the problem.
I initialize my datatables in assets/javascripts/table.js like this:
and in my view I have this:
but the table is empty.
I had to add /current to the working_directory and others on unicorn.rb
working_directory "/home/deployer/apps/sample_app/current"
pid "/home/deployer/apps/sample_app/current/tmp/pids/unicorn.pid"
stderr_path "/home/deployer/apps/sample_app/current/log/unicorn.log"
stdout_path "/home/deployer/apps/sample_app/current/log/unicorn.log"
Thanks for the great work!
If anyone is trying to figure out why their Rails application being served by Passenger just isn't streaming data, you should know that Passenger 3.0.11 introduced a new setting that breaks streaming by default.
PassengerBufferResponse
Has anyone here used Select2 without any problems? It looks pretty awesome, but on github it currently has 76 total downloads, which is discouraging. I just wonder how supported it will be in the future if I were to implement it in an app.
Very helpful!! Thanks
I wanted to check with the community is this is still working for everybody.
I am having issues when using unicorn with a Capistrano deployment. From what I have been able to understand Capistrano uses a scheme in wich every release is deployed inside the releases directory under a unique name and if the transaction was successful, creates a symlink named current that will point to that release.
So I end up with a deployment directory such as:
/home/deployer/apps/sample_app/current
Then when I try to start unicorn from the binstubs directory all the unicorn methods look for things in the following path, particularly in the configurator.rb module:
/home/deployer/apps/sample_app
I haven't been able to fully understand how unicorn sets the working_directory from here:
https://github.com/defunkt/unicorn/raw/master/lib/unicorn/configurator.rb
But I wanted to check with the community if I am missing something evident due to the noob nature in me.
I like the idea of a Rails gem, but even after watching this and looking at the project. I'm still a fan of Grape.
Found a solution to send a prawn generated pdf as an email attachment. Inside your mailer:
def new_subscription(user, invoice)
@invoice = invoice
pdf = SubscriptionPdf.new(@invoice)
attachments["invoice.pdf"] = { :mime_type => 'application/pdf', :content => pdf.render }
mail(:to => user.email, :subject => 'Subscription Receipt', :from => "example@example.com")
end
This is working for me on Rails 3.2
typo: *cast
Great I'll check it out!
Do you know how can I send a pdf generated with prawn as an attachment in an email? Want to send invoices when a customer buys something.
Would really appreciate any help!!!
Great cat as always, very helpful!
Does anyone know how to send a pdf generated with prawn as an attachment? I've search for docs on this and can't find any.
+1
Great Vid Ryan... I didn't notice any quality issues.
I am curious, would Authentication and Authorization work similar to a full rails application?
I've actually run into a similar problem. Rubber blows up toward the end, with:
So, now, I'm off to join the mailing list. ;-)
Sorry. The list is moderated because Google Groups is a spam haven. Your message has gone through now.
It's really hard to provide support here. If you wouldn't mind, please ask the question on the mailing list:
http://groups.google.com/group/rubber-ec2
It looks like your role configs might have gotten out of whack. But, hard to to say with just that snippet.
Rubber generates config into your project. By default we set up HAProxy, but you're welcome to delete that and reconfigure the web server ports. I do that currently: I have apache listen on 80 & 443 and use mod_cluster to some TorqueBox servers.
actually, we can use
config.middleware.http_only!
to let rails run just for api because of removing middlware which not needed.Me too ?
See the video at 9:13.
Sorry, I can not see any benefit of this gem.
If you want to build an API, you really don't need the whole thing called Rails. But before stripping down Rails, think what Rails is. Rails is just a kind of collection of some ruby gems.
So it might be easier to use a more lightweight framework like padrino and put inside what you need.
This is by far the most interesting episode so far. It makes me feel good about being a subscriber to the pro series. Thank you.
Yeah I also noticed the low quality in this video. Some codec related issue it seems.
Very nice done! Thank you!
Nice. i like the vote up thingy..... Just out of curiosity how come you are not precompiling your assets for better performance?
I switched to us-east-1 and changed AMI accordingly. Guess what, It worked on the first attempt. I tried the eu-west-1 numerous times but always getting stuck at the above. Strange! The only explanation I can think of is that the AMIs aren't identical.
I used:
ami-a29943cb for us-east-1
ami-e1e8d395 for eu-west-1
In the EU setup all servers ended up in eu-west-1a (as there are 1a, 1b, 1c) so that cannot be the issue.
Noob getting this error
** [out :: production.genlink.com] rake aborted!
** [out :: production.genlink.com]
** [out :: production.genlink.com] FATAL: role "GenLink" does not exist
** [out :: production.genlink.com]
** [out :: production.genlink.com] Tasks: TOP => environment
** [out :: production.genlink.com]
** out :: production.genlink.com
** [out :: production.genlink.com]
command finished in 16651ms
failed: "/bin/bash -l -c 'cd /mnt/GenLink-production/releases/20120509093404 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on production.genlink.com
Well, you showed the Rails Sexuality :)
Thanks! But video quality is not usual :(
I did, but I don't see my message there !?
msg below:
Hi I have been trying to use the t1.micro image_type on eu-west-1, using the ami-e1e8d395. I can create and bootstrap and even deploy app role servers and db role servers. But unable to even bootstrap the web role server.
It gets stuck while running ./script/rubber config is being run. If I ssh to the server the rvm process is a zombie. If I kill it and run locally I get the same result. Below is what I get when running:
FILTER=web01 cap rubber:booystrap
lots of stuff...
** [out :: web01.foo.com] Resolving deltas: 100% (58/58), done.
command finished in 200394ms
triggering after callbacks for
deploy:update_code'
rubber:passenger:remove_config_ru'* executing
** No servers for task remove_config_ru, skipping
* executing "sudo -p 'sudo password: ' bash -l -c 'cd /mnt/fz-
production/releases/20120508214814 && RUBBER_ENV=production RAILS_ENV=production ./script/rubber config --force --file=\"role/ collectd\"'"
servers: ["web01.foo.com"]
[web01.foo.com] executing command
** [out :: web01.foo.com] Rubber[INFO]: Transforming /mnt/foo- production/releases/20120508214814/config/rubber/role/collectd/
collectd-ping.conf
** [out :: web01.foo.com] Rubber[INFO]: Transforming /mnt/foo- production/releases/20120508214814/config/rubber/role/collectd/
collectd.conf
How to solve this?
Current Gem:
gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git', ref: '6d9c99fe20958ed87e4f1a05e9de19825af702ef'
My mod to mercury.js
Ryan, or anybody who can help :)
i'm planning to use active admin for my website. For some forms, i want to initialize its field assigned with its user information.
For example I have 3 tables, admin_users, agents, packets, admin_users has_one agents, and agents has_many. In Packet new form, i want to assign agent_id field with current agent.
I've been trying to assign before_create in packet model but none is work. So how can I assign value before showing create page?
Yep... https://github.com/leonkenneth/jquery-tokeninput-bootstrap-theme
I think it was built for an older version of bootstrap, I had to set the appropriate widths to 200px for it to look just right. My issues could also be simple_form related, so I'm not sure.
I spent sooo much time on this same issue. Thank you for posting it.
Note that if you're using RVM for multiple sites, you'll want be more specific with your symlinks:
Hi!
Is haproxy required for the web role? Put another way, can I use nginx/apache + passenger for the web role skipping haproxy altogether?
Thx!
rb
No worries. It's kinda hard to really try to debug what's going on here. Mind joining the mailing list and asking there?
http://groups.google.com/group/rubber-ec2
Thanks.
sorry about the t :-)
When using m1.small things work great. But when using t1.micro the web role server fails miserably on bootstrap. Hangs while doing rubber config. Cant't go beyond the transforming collectd.conf. Any ideas?
Hi! I tried to generify the stuff a little bit -- it may be helpful for someone:
https://github.com/metaminded/meta_types
Does anyone know how to make Chosen behave with existing styles? It works in my simple_form based forms but it is completely out of whack with the styling of other elements? My form elements have the labels at the top with the input boxes/dropdowns in the bottom. Chosen forces the labels to be on left hand side. Also it is misaligned.
Any pointers on how to make it blend with the rest of the form?
Thanks.
Bharat
Thanks Brian, will give it a shot.
+1 thanks curtis
Aah, yes of course! Thanks for sharing. I was wondering why it didn't work.
When using a gem like Boostrap for example, how can we include the files provided by the gem to precompile. So far the only way I've been able to make it work is to copy the files needed from the gem to the Rails app. But I feel there must be way to include gem related files to the assets pipeline.
I'm having trouble with a slightly more advanced version of this where I'm trying to use connected sortable lists and sort things between lists. I have a few models (Page, Row, Column, Block) and want to let users drag blocks between columns. The tricky part that I can't figure out is the best way to delete a column/row if it no longer has blocks after sorting. Can anyone help? I posted the question in more detail on stackoverflow here http://stackoverflow.com/questions/10500994/rails-sort-connected-lists-and-delete-empty-parent
My thanks, too, Stuart.
I was having similar issues. I didn't know about the
require_tree .
thing.You have to pass the html_options into the input_html option
SimpleForm README
Please hop on the rubber user list [1] and I'll try to help you out there. Sorry, I misread what you typed earlier as us-west-1. The eu-west-1 AMI is ami-1de8d369 (again, taken from http://alestic.com/).
[1] -- http://groups.google.com/group/rubber-ec2
Sorry, that comment in config/rubber/rubber.yml is misleading. You can use any instance type. Although "m1.micro" doesn't exist -- it's "t1.micro".
Hello, I get this error when trying to create the author_token field using simple_form:
The funny thing is I get that error even if I do this:
Seems that no matter what I put into
:data =>
I keep getting this error. I even get it if I don't usesimple_form
but the regularform_for
tag. I should mention that I'm using Ruby 1.8.7 if that makes any difference.Help please.