Has anyone tried creating the nested forms but allowing only a certain limit of answers or number of questions? Ideally, I would like the jQuery to disable the add link for new question or answer if the number of questions has reached the maximum for that user.
An unexpected error has occurred. We have been notified of the problem.
then this could be due to the fact that you have updated your API. I have a support ticket into Stripe to see what can be done about this. However, currently, I've just bypassed this error using the below coffeescript.
coffeescript --yum
if response.error.message == "An unexpected error has occurred. We have been notified of the problem."
$('input[type=submit]').attr('disabled', false)
else
$('#stripe_error').text(response.error.message)
$('input[type=submit]').attr('disabled', false)
I think that the thing that confuses me with all of these javascript frameworks is, why use Rails at this point? I understand the difference between client side and server side frameworks, but all of these seem to be really intrusive to the Rails framework. Instead of using the application controller and returning a JS on remote: true or having the coffeescript monitor a click, we have to go through this entirely different framework to accomplish a simple task. Does anyone else feel my pain?
It creates
- Twitter Bootstrap
- Sorcery :remember_me and :reset_password
- CanCan 2.0
- Simple_Form
Ran a few successful tests. Definitely cuts out the BS in the setting up of base app and gets into the fun part. Almost reminds me of the yii demo app or asp.net mvc template app.
Huge time saver and less running around to find the old scripts for the authentication reset password stuff!
In some cases, you can help the performance by pushing the assets to a different database. We have to keep detailed logs on a web application to track back changes made and can do this through having a beefier database server to handle the queries of the live logs.
To keep those pesky credentials from being in your application code.
If you want to reuse this connection in multiple models, you should create a new abstract class and inherit from it, because connections are tightly coupled to classes (as explained here, here, and here), and new connections will be created for each class.
Good information, but most of these steps are almost hard coded into my brain already. However, I do see where it can be useful for creating templates for certain configurations with twitter-bootstrap, cancan, sorcery/devise, user model, etc. with the most commonly used gems.
Though, usually it only takes a few minutes to do this stuff now.
Didn't know about the appscrolls. Does seem useful.
Don't forget that if you are going to use something like this in a secure environment (SSL) then you should get a wildcard certificate. Otherwise your clients will get certificate errors.
Has anyone else had issues and found a resolution when using Outlook or any kind of multipart/HTML email and have it format nicely. How did you handle email signatures with images?
I've taken the concept of if a user has voted for something and taken it a step further. The user can see if they have up voted something or down voted something.
I'm tending to agree after my initial relooks at Devise. I liked how Sorcery is very non invasive. However, it doesn't seem to be as fully functional out of the box. There's a bit more configuration work to be done with it (not always a bad thing).
I'm wondering if the encrypted password that Devise uses is more secure or equally as secure as the salted password that Sorcery users. The last thing that I would want to happen is to be a repeat of what LinkedIn recently faced. Any thoughts?
The only issue that I saw with the CSV export was that it would return all data from that table. I put it on a user list and has to make a index.csv.erb file that would post just the required data.
Not a big deal since I was able to put in whatever information I wanted.
ruby
FirstName,LastName,EmailAddress,Status,Company,LastLogin,LastIP
<% @users.eachdo |user| %>
<%= user.first_name %>,<%= user.last_name %>,<%= user.email %>,<%= "Active" if user.user_status %><%= "Inactive" if not user.user_status %>,<%= user.company.company_name %>,<%= time_ago_in_words(user.updated_at.localtime) %>,<%= user.ipaddress %>
<% end %>
Copycopter will be shutting down on April 15. It's a shame to see useful features die. I'm sure that they had good reasons, unlike they're like Google with Google Wave or Fox with any awesome show that died after 1/2 - 1 season.
How did you get around the Twitter Bootstrap and Stripe issue?
I'm having issues in development mode where it's always returning an error with Invalid Token on the card. It's like it's trying to submit to Stripe with no card information.
How would you handle having different configurations? Let's say a User logs into the system. Under their Account Settings, they can put in their pop/smtp settings and then use ActionMailer and MailMan with those settings vs having one configured for global use. One of the reasons why I ask is because the SendMail app within linux keeps getting flagged as spam and/or never reaches it's destination. However, this doesn't happen when using a SMTP server. I know that this is a bit off topic in general.
How would you incorporate this with a many to many association where you have a product and category and an association model with product_id and category_id?
You can also create a default one for any field. This will search for any value in any column.
Any Clause
when "allfields"
where('firstname LIKE ? OR lastname LIKE ? OR email LIKE ? OR manager LIKE ? OR address1 LIKE ? OR address2 LIKE ? OR city LIKE ? OR state LIKE ? OR zipcode LIKE ? ', "%#{search}%","%#{search}%", "%#{search}%","%#{search}%", "%#{search}%","%#{search}%", "%#{search}%","%#{search}%", "%#{search}%")
Instead of just using name to search on, you can modify your model to include the field you wish to search on.
model
def self.search(search,type)
if search
case type
when "firstname"
where('firstname LIKE ?', "%#{search}%")
when "lastname"
where('lastname LIKE ?', "%#{search}%")
when "email"
where('email LIKE ?', "%#{search}%")
end
else
scoped
end
end
Looks like they have updated the :views file. If you're wanting to add the First/Previous/Next/Last in the view so that it doesn't disappear when appropriate, just remove the lines
For anyone wondering, this can now be accomplished by typing
passenger start
from the root of your application.Why couldn't you do
render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity.trackable_type.underscore.to_sym => activity
instead of creating the presenter. This seems much easier and less cluttered.
Just for those who want their program to create the cron
0 9 1 * *
which executes on the first day of each month at 9AM, you can do this.This is the same as
:at => "9am"
but is more humanized.Good screencast. However, one thing left out that was mentioned in the original ones is the
:reject_if => :all_blank
in the model.I am finding this to be the case as well. Have you found any work arounds?
+1.2
Has anyone tried creating the nested forms but allowing only a certain limit of answers or number of questions? Ideally, I would like the jQuery to disable the add link for new question or answer if the number of questions has reached the maximum for that user.
If you are receiving an error message similar to
An unexpected error has occurred. We have been notified of the problem.
then this could be due to the fact that you have updated your API. I have a support ticket into Stripe to see what can be done about this. However, currently, I've just bypassed this error using the below coffeescript.
I think that the thing that confuses me with all of these javascript frameworks is, why use Rails at this point? I understand the difference between client side and server side frameworks, but all of these seem to be really intrusive to the Rails framework. Instead of using the application controller and returning a JS on
remote: true
or having the coffeescript monitor a click, we have to go through this entirely different framework to accomplish a simple task. Does anyone else feel my pain?I take back what I said. It is more of a time saver than I had originally thought. I've posted the below generator.
https://github.com/kobaltz/app_template_generator
It creates
- Twitter Bootstrap
- Sorcery :remember_me and :reset_password
- CanCan 2.0
- Simple_Form
Ran a few successful tests. Definitely cuts out the BS in the setting up of base app and gets into the fun part. Almost reminds me of the yii demo app or asp.net mvc template app.
Huge time saver and less running around to find the old scripts for the authentication reset password stuff!
In some cases, you can help the performance by pushing the assets to a different database. We have to keep detailed logs on a web application to track back changes made and can do this through having a beefier database server to handle the queries of the live logs.
Then in your special model:
To keep those pesky credentials from being in your application code.
If you want to reuse this connection in multiple models, you should create a new abstract class and inherit from it, because connections are tightly coupled to classes (as explained here, here, and here), and new connections will be created for each class.
If that is the case, set things up like so:
Good information, but most of these steps are almost hard coded into my brain already. However, I do see where it can be useful for creating templates for certain configurations with twitter-bootstrap, cancan, sorcery/devise, user model, etc. with the most commonly used gems.
Though, usually it only takes a few minutes to do this stuff now.
Didn't know about the appscrolls. Does seem useful.
It would be neat if you showed how to make the slugs unique only to their parents and not site wide.
Don't forget that if you are going to use something like this in a secure environment (SSL) then you should get a wildcard certificate. Otherwise your clients will get certificate errors.
If you add this to the model, then these items will no longer appear on your dropdown list.
However, if you remove exclude an item using the list above, it will no longer become sortable.
I agree. I plan to use this on my app. I'll probably check the size and if it's more than 5 items for that day will have a
<%= link_to "#{@model.size} more ...", list_of_models_path(@model) %>
Has anyone else had issues and found a resolution when using Outlook or any kind of multipart/HTML email and have it format nicely. How did you handle email signatures with images?
I've also used cancan to limit the user from voting on their own Answer/Question/Post.
I've taken the concept of if a user has voted for something and taken it a step further. The user can see if they have up voted something or down voted something.
This came in handy when I was checking to see if the user has up voted or not so I could change the image.
I'm tending to agree after my initial relooks at Devise. I liked how Sorcery is very non invasive. However, it doesn't seem to be as fully functional out of the box. There's a bit more configuration work to be done with it (not always a bad thing).
Sorry. Didn't fully understand your question. Answered prior to watching episode. ><
I'm wondering if the encrypted password that Devise uses is more secure or equally as secure as the salted password that Sorcery users. The last thing that I would want to happen is to be a repeat of what LinkedIn recently faced. Any thoughts?
In your model you can do something like this
validates_presence_of :password, :on => :create
The only issue that I saw with the CSV export was that it would return all data from that table. I put it on a user list and has to make a index.csv.erb file that would post just the required data.
Not a big deal since I was able to put in whatever information I wanted.
Copycopter will be shutting down on April 15. It's a shame to see useful features die. I'm sure that they had good reasons, unlike they're like Google with Google Wave or Fox with any awesome show that died after 1/2 - 1 season.
I found that in order for the card to process with your example, I had to put the variables in the card around
{ }
and also delimit them with a comma.How did you get around the Twitter Bootstrap and Stripe issue?
I'm having issues in development mode where it's always returning an error with Invalid Token on the card. It's like it's trying to submit to Stripe with no card information.
How would you handle having different configurations? Let's say a User logs into the system. Under their Account Settings, they can put in their pop/smtp settings and then use ActionMailer and MailMan with those settings vs having one configured for global use. One of the reasons why I ask is because the SendMail app within linux keeps getting flagged as spam and/or never reaches it's destination. However, this doesn't happen when using a SMTP server. I know that this is a bit off topic in general.
How would you incorporate this with a many to many association where you have a product and category and an association model with product_id and category_id?
You can also create a default one for any field. This will search for any value in any column.
Instead of just using name to search on, you can modify your model to include the field you wish to search on.
<%= select_tag "fieldtype", options_for_select([ "firstname", "lastname", "email" ], "firstname") %>
instead of commenting out, try to remove the
#unless current_page.first?
#unless current_page.last?
Looks like they have updated the :views file. If you're wanting to add the First/Previous/Next/Last in the view so that it doesn't disappear when appropriate, just remove the lines
unless current_page.first?
unless current_page.last?
in the
_paginator.html.erb
file