class ABC
def self.active
self.live.where('starts_at <= ?', Time.now).where('(ends_at > ? || ends_at
IS NULL)', Time.now)
end
def self.recently_completed`
self.completed.where("completed_at > ?", 2.days.ago)`
end
The issue is when I do:
(ABC.active + ABC.recently_completed).c
Hi,
Following is the code,
shared_context "of cloning" do
>
let(:cloned_record) {donor.dup}
> let(:second_cloned_record) {donor.dup}
> * let(:clone_of_cloned) {cloned_record.dup}*
>
> it "returns new record" do
> cloned_record.should be_new_record
> end
>
> it "saves returned reco
Hi,
I have a partial which is being rendered in a view in controller A. This
partial has a form which calls 'update' action in controller B. If update
fails I have the render back the original view again with the proper
errors. I used,
render :action => :show
This show action is actually is t
On 15 March 2013 16:41, tamouse mailing lists wrote:
> On Thu, Mar 14, 2013 at 5:16 AM, Sumit Srivastava
> wrote:
> > Also I did try it this way,
> >
> > arel = OfferOrder.includes(:a, :b).joins(:c).select('(CASE WHEN
> > ISNULL(c.fields2) THEN c.fields1 ELSE
Also I did try it this way,
arel = OfferOrder.includes(:a, :b).joins(:c).select('(CASE WHEN
ISNULL(c.fields2) THEN c.fields1 ELSE c.field2 END) ')
Got error,
ActiveModel::MissingAttributeError (missing attribute: a_id):
I did join on three tables.
>
> arel = OfferOrder.includes(:a, :b, :c) a
I did join on three tables.
arel = OfferOrder.includes(:a, :b, :c) arel = arel.select('(CASE WHEN
ISNULL(c.field2) THEN c.field1 ELSE c.field2 END) AS fraud')
but when I run my code it gives error that
(Mysql2::Error: You have an error in your SQL syntax; check the manual that
corresponds to
Hi,
I have to add contraints (CHECK) on a sql table through rails migration.
How should I? I googled and got to know about using something as follows,
def self.up
execute "ALTER TABLE table_name ADD CONSTRAINT check_constraint_name
CHECK (check_column_name IN (1, 2, 3) )"
end
But am not su
ne. How to do that?
Thanks,
Sumit
>
> On Friday, 8 February 2013 11:17:41 UTC+5:30, Sumit Srivastava wrote:
>>
>> Hi,
>>
>> I have a model PlayerScore with unique key as (dt, player_id). I have
>> create associations between Player model and PlayerScore model
On 13 February 2013 18:32, Colin Law wrote:
> On 13 February 2013 12:31, Sumit Srivastava
> wrote:
> > Hi,
> >
> > I have added a route to my routes.rb as following,
> >
> > get "/order/:player_id/:order", :to => 'share#order_renderer'
Hi,
I have added a route to my routes.rb as following,
get "/order/:player_id/:order", :to => 'share#order_renderer', :as =>
:order_feed
It works for me in the app but when I am running the spec file for, it
says, not route matches for this controller, action, parameters.
Regards,
Sumit
--
Hi,
I have a model PlayerScore with unique key as (dt, player_id). I have
create associations between Player model and PlayerScore model to display
the score on Player screen. Had it been just the score_id as the
foreign_key a simple association with belongs_to and has_one would have
helped.
I hope that helps.
>
>
>
I was sending the errors to the view from the controller. I found out that
since the errors where not from the base model (User) so it wasn't
displaying them. Once I added them to the base using errors.add(:base,
"Error"), it started displaying
Hi,
I have a model,
class UserComment
belongs_to :user
validates :player_id, :presence => true
validates :comment, :uniqueness => { :scope => :player_id}
partial "comments" from User.
= simple_form_for @user, :html => {:class => 'comment-form'}, :remote =>
true do |f|
%fieldset
= f.fields
On Sunday, 16 December 2012 19:49:11 UTC+5:30, Nikolay wrote:
>
> After entering data in http://localhost:3000/checkout/update/address form
> i getting the following error:
>
> NoMethodError in Spree::CheckoutController#update
>
> undefined method `user_id=' for #
>
>
> A error chunk of Developm
On 13 December 2012 12:18, Jim Ruther Nill wrote:
>
>
>
> On Thu, Dec 13, 2012 at 1:56 PM, sumit srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>> On 13 December 2012 11:23, Jim Ruther Nill wrote:
>>
>>>
>>>
>
On 13 December 2012 11:23, Jim Ruther Nill wrote:
>
>
>
> On Thu, Dec 13, 2012 at 1:48 PM, sumit srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>>
>> On 13 December 2012 11:17, sumit srivastava <
>> sumit.theinvinci...@gmail.com> wrote:
On 13 December 2012 11:17, sumit srivastava
wrote:
>
> On 13 December 2012 11:13, Jim Ruther Nill wrote:
>
>>
>>
>>
>> On Thu, Dec 13, 2012 at 1:31 PM, Sumit Srivastava <
>> sumit.theinvinci...@gmail.com> wrote:
>>
>>> Hi,
>>
On 13 December 2012 11:13, Jim Ruther Nill wrote:
>
>
>
> On Thu, Dec 13, 2012 at 1:31 PM, Sumit Srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>> Hi,
>>
>> I am using thin web server in my rails project. But it gives stack level
>> too de
Hi,
I am using thin web server in my rails project. But it gives stack level
too deep error. Couldn't find any appropriate solution to this.
I have tried updating the ruby but didn't help.
Regards,
Sumit
--
You received this message because you are subscribed to the Google Groups "Ruby
on R
On 10 December 2012 13:06, Jim Ruther Nill wrote:
>
>
>
> On Mon, Dec 10, 2012 at 3:34 PM, Sumit Srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>> Hi,
>>
>> I am using dataTables to render my content onto a view. I need to change
>> the b
Hi,
I am using dataTables to render my content onto a view. I need to change
the background color of a row depending upon ratio of values of two
columns. How shall I proceed. I went through following page on dataTables
website but it didn't work for me.
http://www.datatables.net/examples/ad
On 7 December 2012 14:59, Colin Law wrote:
> On 7 December 2012 06:02, Sumit Srivastava
> wrote:
> > Hi,
> >
> > I just encountered a MySql error for ambiguous columns. I fixed it but I
> > need to write test cases for such happenings to avoid any such instance
>
Hi,
I just encountered a MySql error for ambiguous columns. I fixed it but I
need to write test cases for such happenings to avoid any such instance in
future.
Regards,
Sumit
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to
Thanks. Got it fixed.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 7 December 2012 10:07, sumit srivastava wrote:
> On 7 December 2012 09:54, Jordon Bedwell wrote:
>
>> On Thu, Dec 6, 2012 at 10:20 PM, Sumit Srivastava
>> wrote:
>> &g
On 7 December 2012 09:54, Jordon Bedwell wrote:
> On Thu, Dec 6, 2012 at 10:20 PM, Sumit Srivastava
> wrote:
> > I am doing a join of two tables with a column with same name in both. I
> am
> > using "includes" to have a full join. This is giving ambiguous column
Hi,
I am doing a join of two tables with a column with same name in both. I am
using "includes" to have a full join. This is giving ambiguous column
error. The columns cannot be removed from either of those and renaming any
of the two would involve two many changes. So, is there any way this ca
On 30 November 2012 14:16, Colin Law wrote:
> On 30 November 2012 06:50, sumit srivastava
> wrote:
> > Verified it. Don't have puts anywhere else.
>
> Jim asked you to post the contents of the log (log/development.log)
> when you click the link. Why have you not done
Verified it. Don't have puts anywhere else.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 30 November 2012 11:39, Jim Ruther Nill wrote:
>
>
>
> On Fri, Nov 30, 2012 at 1:50 PM, sumit srivastava <
> sumit.theinvinci...@gmail.com> wr
If it were being directed to some other action, then *** should
not have been printed. And when I am trying to access this parameter from
the view "index.html.haml", its value is printed exactly what is being
passed.
Regards
Sumit Srivastava
The power of imagination makes u
On 30 November 2012 10:55, Jim Ruther Nill wrote:
>
>
>
> On Fri, Nov 30, 2012 at 1:16 PM, sumit srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>> On 30 November 2012 10:41, Jim Ruther Nill wrote:
>>
>>>
>>>
>
On 30 November 2012 10:41, Jim Ruther Nill wrote:
>
>
>
> On Fri, Nov 30, 2012 at 12:51 PM, Sumit Srivastava <
> sumit.theinvinci...@gmail.com> wrote:
>
>> Hi,
>>
>> I have a controller named Users with index action.
>>
>&g
Hi,
I have a controller named Users with index action.
def index
puts "* #{params[:city]}"
...
...
end
>From the view,
link_to(:city, list_users_with_city_path(:city => city.name))
But when I click on this link, it doesn't prints out anything for the
params. All the "*"
I need to add a functionality to a code someone else wrote. Just found out
that, the dataTables jquery is just being used to sort and paginate the
table. But the table is actually populated through controller.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 29
Actually Jquery dataTables is being used to fetch the data and create the
table.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 29 November 2012 15:48, Jordon Bedwell wrote:
> On Thu, Nov 29, 2012 at 4:15 AM, Colin Law wrote:
> > The Rails Guide on For
Hi,
I have a view in which a table is created with one head elements of the
table are defined like,
%table.data-table{'data-searchable' => 'true'}
%thead
%tr
%th Email
%th.no-sort Name
%th Registered
%tbody
The table is populated through controller. I need to add a se
Thanks Rahul. If possible could you explain any more cases as I faced. It
would be helpful.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 28 November 2012 15:32, rahul chandra wrote:
> well for understanding, If you add a symbol like(:city) in the routes
2012 14:30, Jordon Bedwell wrote:
> On Wed, Nov 28, 2012 at 2:57 AM, sumit srivastava
> wrote:
> > Yes, I did try this but it didn't. In fact, the custom route I defined,
> if I
> > define it as following it works.
> >
> > get '/users' => 'use
Hi,
I have a controller named users and index action in it. By default I have
the path
get '/users' => 'users#index', :as => 'users'
Now I want to create one more path with a different parameter being passed
get '/users/:city' => 'users#index', :as => 'list_users'
But this gives as error, No
Hi,
I have been trying to deploy a Rails project using Nginx and thin but
always displays the Default page only.
I did following configurations,
Step 1: Made a symlink of my project in /var/www
Step 2: Installed thin and Nginx.
Step 3: Added Upstream block in the nginx.conf file
Step 4: Changed
Colin,
Yes, I did. I was using wrong dom id to save the tokeninput data and that
was misleading my app.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 15 August 2012 13:36, Colin Law wrote:
> On 13 August 2012 11:33, Colin Law wrote:
> > On 13 August 2
On 13 August 2012 15:09, Colin Law wrote:
> On 13 August 2012 10:19, sumit srivastava
> wrote:
> >
> >>
> >
> > On 13 August 2012 14:33, Colin Law wrote:
> >>
> >> On 13 August 2012 09:45, Sumit Srivastava <
> sumit.theinvinci...@gmail.c
On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote:
>
> On 13 August 2012 08:40, sumit srivastava
> >
> wrote:
> > I went through the log. The contact_tokens parameter is being passed as
> nil,
> > i.e., "contact_tokens"=>"".
&
I went through the log. The contact_tokens parameter is being passed as
nil, i.e., "contact_tokens"=>"".
This is happening even when the text field is actually populated.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 13 August 2012 12:27, Col
Hi,
I made a contact manager app using rails. I added TokenInput plugin to
introduce an instant contact search functionality in it. Tried following a
railscast http://railscasts.com/episodes/258-token-fields but have been
struggling with it for a while. Following is the code I use in my view
By "didn't execute", I mean that when I use "password" as name of this
method, it is called some way. But the same doesn't happens when it is
named as "passwordtext", i.e., it is not even called.
Regards
Sumit Srivastava
The power of imagination make
I am trying to integrate Cassandra with Rails using the method described on
this page,
https://github.com/dtmconsultoria/cassandra-integration
I made a small change. I created a rails app with two variables, Name and
Age. Name of the app is user.
After I did this,
I ran the rails server. Everyt
enamed the
password_field_tag in the view as "passwordtext". Doing this didn't help at
all as the passwordtext method didn't execute.
So, the problem how should I rename my variables to make it work.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 29
Right now I have renamed it to passwordtext but originally it was password.
I wrote about its behavior when named as password.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 27 July 2012 19:39, Michael Pavling wrote:
> On 27 July 2012 11:52, sumit srivast
me same as that of the column
*password.
Am I right?
*Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 27 July 2012 16:12, Michael Pavling wrote:
> On 27 July 2012 11:37, sumit srivastava
> wrote:
> > This is what I receive,
> >
> > SystemStack
User.random_string does not exists any more. So had to use *
SecureRandom.hex(10)*
On Friday, 27 July 2012 11:52:43 UTC+5:30, Sumit Srivastava wrote:
>
> I have been following following tutorial to make a user login session.
> http://www.aidanf.net/rails_user_authentication_tutorial
&
is used to store the user info into database.
Line 31 reads as follows,*
@user = User.new(params[:user])*
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 27 July 2012 16:00, Michael Pavling wrote:
> On 27 July 2012 11:13, sumit srivastava
> wrote:
> > D
ord_field_tag* in my form as *
passwordtext*. But when I do so, it is not executed. Instead if I rename
the password_field_tag and the attr_accessor as* password *only, it is
executed but the stackerror comes in.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 27 July
I am not exactly following the tutorial. I have customized things according
to my requirements.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 27 July 2012 15:12, sumit srivastava wrote:
> This is the complete model. I am trying to encrypt the passw
end
>
> def passwordtext=(pass)
> #debugger
> @password1=pass
> self.salt = SecureRandom.hex(10) if !self.salt?
> self.password = User.encrypt(@password1, self.salt)
> end
>
> def self.encrypt(pass, salt)
>Digest::SHA1.hexdigest(pass+salt)
>
I have been following following tutorial to make a user login session.
http://www.aidanf.net/rails_user_authentication_tutorial
I used the following action to encrypt the password.
> def password
> #debugger
> @password1=pass
> self.salt = SecureRandom.hex(10) if !self.salt?
>
What else could be the solution?
On Thursday, 26 July 2012 10:41:34 UTC+5:30, Sumit Srivastava wrote:
>
> Hi,
>
> I have been trying to develop a sample app to create user logins and
> provide them personalized contact list with several features as of view,
> delete, edit, sen
Hi,
I have been trying to develop a sample app to create user logins and
provide them personalized contact list with several features as of view,
delete, edit, send mail, etc. Everything is working fine except the destroy
action. Every time I call it, the session[:user] variable is destroyed,
Frederick!
I deleted all the pre-compiled assets in public folder and restarted my
machine. It worked! Thanks :-)
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 25 July 2012 20:49, Frederick Cheung wrote:
>
>
> On Jul 25, 10:25 am, sumit srivastava
>
Tried it now. Didn't help.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 25 July 2012 15:42, Gintautas Šimkus wrote:
> I always forget, but you might want to try EXPLICITLY "true" at the end
> (if session[:user] is FALSE). I mean just use r
ntactsController*.
Also I have another controller *Usercontroller *which is responsible for
login actions and contacts controller is responsible to manage contacts
list of every user.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 25 July 2012 15:31, Gintautas Šimku
Peter,
I added code for session management where one user can login only using one
browser at a time. Other than that I tried production mode of the app.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 25 July 2012 15:25, Peter Hicks wrote:
>
> On 25 Jul 20
I was actually looking to insert custom error pages. On Googling I got to
know production mode produces error page by default. I just wanted to
explore it and ran it in production mode. The production mode required some
pre-compiled files so just did that.
Regards
Sumit Srivastava
The power of
I do have before_filter and to make sure they aren't messing up things, I
ran my app after removing them but nothing changed. The same code was
running fine earlier but now I am not able to get where it has got problem.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
I am currently running my app in development mode. This log is of
development mode. Am not able to deduce what exactly went wrong.
Regards
Sumit Srivastava
The power of imagination makes us infinite...
On 25 July 2012 14:53, Frederick Cheung wrote:
>
>
> On Wednesday, July 25, 201
I pre-compiled my app to use in production mode. And after that it started
to perform every action twice. I am not able to resolve it. My log comes
something like this.
Started GET "/assets/lowpro.js?body=1&_=1343203450861" for 127.0.0.1 at Wed
> Jul 25 13:34:10 +0530 2012
> Served asset /lowp
I am having problem retrieving the value for variable
request.session_options[:id] from my controller. Though the same returns a
proper value when accessed through a view. I am not able to understand why
it is happening.
--
You received this message because you are subscribed to the Google Gro
Hi,
I need to create an app where one user cannot login using multiple
browsers. As soon as he does, the previous one logs out.
I have a user table with a field named "current_sign_in_token' to store the
session key generated by one login.
But I am not able to retrieve the session key. Actuall
ere destroySelected is the action in controller to delete these.
Code for the destroySelected action is,
def destroySelected
> Contact.delete_all(:id => params[:id])
> respond_to do |format|
> format.html {redirect_to contacts_url}
> #format.js
> end
>
2012
> Processing by ContactsController#destroySelected as JS
> Parameters: {"contact_ids"=>"contact_ids[]"}
> SQL (0.1ms) DELETE FROM "contacts" WHERE "contacts"."id" IS NULL
> Redirected to http://localhost:3000/contacts
> Completed 302
I am aware of that. But I am not able to figure out the way I should pass
the parameters. I need help with that.
On Friday, 20 July 2012 19:28:19 UTC+5:30, Hassan Schroeder wrote:
>
> On Fri, Jul 20, 2012 at 2:11 AM, Sumit Srivastava
> wrote:
>
> > Started GET &qu
I have been trying to upgrade the project using the method on several blogs
but failed to do so as the first command to install the plugin itself
fails. Following is the error I get,
sumit@sumit:~/Downloads/railscasts-198-edit-multiple-individually-02eb1c8/store$
ruby script/plugin install git
ontacts" WHERE "contacts"."id" IS NULL
Rendered contacts/destroySelected.js.erb (0.0ms)
Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.1ms)
On Thursday, 19 July 2012 19:57:39 UTC+5:30, Hassan Schroeder wrote:
>
> On Thu, Jul 19, 2012 at 12:37 AM, Sum
I have build a contacts page which displays a number of contacts. I have
attached a check_box_tag with each row of these. And then a button to
delete those selected. But it is not working. Following is the code snipet,
_contact.html.erb
> <% @contacts.each do |contact| %>
>
> <%= check_b
I am a newbie to Rails. Trying to make a small contact form app. I want to
use AJAX to add new contact. I want a dialog to open when I click on 'New
Contact' button and then entering details over there. I did following steps:
1] added :remote => true to the new_contact_path line on index.html.er
74 matches
Mail list logo