You should look into ActiveModel
http://railscasts.com/episodes/219-active-model
This will allow you to create model that has certain ActiveRecord like
capabilities like validations without the need for a database.
Look at the mail_form gem
(https://github.com/plataformatec/mail_form/blob/master/
Does using flash.now help?
http://handyrailstips.com/tips/15-knowing-when-to-use-flash-now
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@
You can include helper modules in your spec_helper file:
RSpec.configure do |config|
config.include MySpec::SessionsHelper, :type => :controller,
:example_group => {
:file_path => config.escaped_path(%w[spec controllers])
}
end
This will include the MySpec::SessionsHelper in all of
Try adding this to your spec_helper.rb
Spork.each_run do
require 'factory_girl_rails'
end
adam wrote in post #976883:
> Strangely - I am not getting this error when running seperate
> features, only when running just "cucucmber --drb"
--
Posted via http://www.ruby-forum.com/.
--
You receiv
> But don't you always need to do that? Isn't that the task that clears
> out the test DB? Or is that not an issue since you're (hopefully)
> running your specs transactionally?
As far as I can tell, the difference between 'rake spec' and 'rspec
spec' is 'db:test:prepare'. When all tests pass w
1) If your running 'rake spec', then don't, unless you need to do 'rake
db:test:prepare' also. The 'rake spec' command combines the database
rake with 'rspec spec', that's why it takes a few seconds before the
tests are run. Use 'rspec spec' instead.
2) Use Spork and Autotest. Follow
http://ra
It seems to me that it would be hard to target users with such a wide
range of experiences (beginner to expert). I'm not familiar with
adaptive learning techniques, but if I'm a moderate level user, I
wouldn't want to sit through too much beginner level stuff to get
through to the more advanced
Did you create your VideoOne model yet? FactoryGirl requires that this
be present.
Here's some general background on FactoryGirl
http://www.arailsdemo.com/posts/39.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
o
You can try installing the gem outside of Bundler.
> gem install sqlite3-ruby
or if you're not using RVM
> sudo gem install sqlite3-ruby
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To pos
Try running 'bundle install' (or 'bundle' for short) from the command
line and then repushing to Heroku. If that doesn't work, try 'bundle
update'.
Make sure you run bundle install anytime after changing your Gemfile.
About Gemfile.lock:
If you have
gem 'rails'
in your Gemf
If you haven't worked with the lib/ directory before, make sure you have
config.autoload_paths += %W(#{config.root}/lib)
in config/application.rb
Also, if you ever want to make yourself a gem, you could do something
like
# lib/acts_as_chunky_time
module ActsAsChunkyTime
def self.inc
Looks like you have Casting has_many :comments, and you have a comment
form on your Casting show page. If so, then you just need to render your
casting show page. But this requires you to supply the Casting show page
the @casting variable in your controller.
...
else
@casting = Casting.find(@
These methods are not generating any HTML, so they should not be in a
view helper. Like you said, they are not needed for controller function,
so they shouldn't be in the ApplicationController. So I would put them
in your model.
You can put this logic in a module in your lib/ directory. This way i
Uninitialized constant usually means that the the module hasn't been
loaded into the Rails environment. Adding an initializer file might fix
it, but it seems to me that this shouldn't be necessary with Authlogic.
Make sure you're using the most updated version of Authlogic.
# config/initialize
Have you checked out the Twitter gem?
https://github.com/jnunemaker/twitter
To pull your tweets, you probably could just the Twitter::Search class.
If you want to be able to make tweets from your app, then you'll have to
go to dev.twitter.com to register you app with Twitter. Then you can
take th
"e.g. ruby script/generate model ad name : string ,"
Did you put spaces between 'name' ':' and 'string'? If you did, take
them out.
> script/generate model ad name:string.
If you don't know about http://railstutorial.org/book then you might
want to check that out.
--
Posted via http://www.ru
You need to take the redirect_to out of the about_us action, and instead
just set an instance variable that has the comments that you want to
display.
# app/controllers/pages_controller.rb
class Pages < ApplicationController
def about_us
@comments = Comment.all
end
end
Then all you nee
How about just creating your own module and including that in your
classes?
# lib/common_methods.rb
module CommonMethods
def all_get_this_method
...
end
end
app/models/company.rb
require 'common_methods'
class Company < Active::Record::Base
include Commonmethods
...
end
config/appl
Oops. Correction on the above answer. It should be GET instead of POST.
If there is no javascript, the delete link sends a get request to your
server. A get request on an existing record gives you the edit action.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because
Sounds like you don't have any javascript files in your Rails app.
Remember that the destroy method uses javascript to work correctly. If
javascript is missing, then the browser sends a POST request to your
Rails server. If you send a post request to an existing record, you get
the edit action
Did you include the module?
class YourController < ApplicationController
include ActionView::Helpers::SanitizeHelper
Christian Fazzini wrote in post #958461:
> Arailsdemo, I dont think the sanitize helper works in the controller
> level. I get the error: undefined method `sanitize
>
> Marnen,
I get that same "...open=false>" in my console when connecting to S3.
Can you transfer a file through the console commands? See
http://amazon.rubyforge.org/
Also, in the s3.yml file, do you have things in quotes?
development:
bucket: 'teneventsdevelopment'
access_key_id: 'asdfa324234'
secr
1. The polymorphic part isn't necessary. If you just expect to have one
model that has file attachments then it's not going to help you.
However, if you have multiple models that have attachments, then you
might want to go the polymorphic way. See
http://guides.rubyonrails.org/association_basic
Try this
class YourController < ApplicationController
include ActionView::Helpers::SanitizeHelper
def your_action
redirect_to(:back, :notice => sanitize("Photo was successfully
created. Click here to view it"))
end
end
If you haven't used the sanitize method before, please read this
ht
Did you set up your S3 bucket for your app?
I wrote up how to do this set up here http://www.arailsdemo.com/posts/15
Hopefully that will get you going.
Michael Baldock wrote in post #958147:
> Thanks for the help Walter, I tried what you said, putting them in a
> different order, still doesn't
You want to set your comment variable in the controller:
def new
@comment = @post.comments.build
end
so your form is
<%= form_for([...@post, @comment]) do |f| %>
<%= render"shared/error_messages", :target => @comment %>
<% end %>
If you build the comment in the form (which you shouldn't be
Ryan Bates did an Railscast episode on syntax highlighting libraries
(http://railscasts.com/episodes/207-syntax-highlighting). I am using
CodeRay for my site. It was pretty straight forward to use.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribe
27 matches
Mail list logo